<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 7 May 2019, at 20:47, Kirill Shcherbatov <<a href="mailto:kshcherbatov@tarantool.org" class="">kshcherbatov@tarantool.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">
<div class=""><p style="margin-top: 0px;" dir="ltr" class="">;<br class="">
> +          if (sql_bind_decode(&bind, i + 1, &new_tuple) != 0 ||<br class="">
> +              sql_bind_column(ck_constraint->stmt, &bind, i + 1) != 0) {<br class="">
> +                  diag_set(ClientError, ER_CK_CONSTRAINT_FAILED,<br class="">
> +                           ck_constraint->def->name,<br class="">
> +                           ck_constraint->def->expr_str);<br class="">
> +                  return -1;<br class="">
>This looks like a pessimization to me. Depending on the >code flow,<br class="">
>some of the tuple fields may not be accessed at all. Is it >really<br class="">
>necessary to decode them so agressibvely here? <br class="">
>Especially since<br class="">
>you encode *all* space fields.</p><p dir="ltr" class="">I'll try to walk though the AST tree and prepare the map of fields that are involved in expression (on check compile operation);<br class="">
Here there would be binding of **used** fields.</p><p dir="ltr" class="">What do you think?</p></div></div></blockquote></div>To be honest, I don’t get what Konstantin really meant in his next letter.<div class="">I’m ok with your approach.</div><div class=""><br class=""></div></body></html>