From: Kirill Shcherbatov <kshcherbatov@tarantool.org> To: tarantool-patches@freelists.org, Vladislav Shpilevoy <v.shpilevoy@tarantool.org> Subject: [tarantool-patches] Re: [PATCH v1 4/4] sql: get rid of Column structure Date: Wed, 18 Jul 2018 10:25:38 +0300 [thread overview] Message-ID: <55a87410-6db0-f51f-722a-6e9cb8795341@tarantool.org> (raw) In-Reply-To: <64852e2e-a07a-e86c-ad93-c17c6f55a0aa@tarantool.org> > 1. Please, rebase on the latest 2.0 and use pk->def + key_def_find. - if (index_has_column(pk, pNew->def->field_count - 1)) { + assert(pk != NULL); + struct key_def *pk_key_def = pk->def->key_def; + if (key_def_find(pk_key_def, pNew->def->field_count - 1) != NULL) { > 2. As I said verbally, you should not add this redundant scan of primary > index columns. You already have the primary index scan in > convertToWithoutRowidTable, that is called few lines above. > > When you merge this scan into convertToWithoutRowidTable, you can > inline the rest of the function into EndTable and remove it together > with index_has_column. I can't understand your suggestion. convertToWithoutRowidTable iterates by index field; but this check is a about field with ON CONFLICT REPLACE could be only a part of index. We iterate over all fields. I've get rid off index_has_column. if (field->nullable_action == ON_CONFLICT_ACTION_REPLACE && - !index_has_column(pk, i)) + (pk == NULL || key_def_find(pk->def->key_def, i) == NULL)) -bool -index_has_column(struct Index *index, uint32_t column_idx) etc.
next prev parent reply other threads:[~2018-07-18 7:25 UTC|newest] Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-12 16:34 [tarantool-patches] [PATCH v1 0/2] sql: restrict nullable action definitions Kirill Shcherbatov 2018-07-12 16:34 ` [tarantool-patches] [PATCH v1 1/2] " Kirill Shcherbatov 2018-07-13 10:26 ` [tarantool-patches] " Vladislav Shpilevoy 2018-07-13 16:05 ` Kirill Shcherbatov 2018-07-13 20:03 ` Vladislav Shpilevoy 2018-07-16 9:43 ` Kirill Shcherbatov 2018-07-16 10:20 ` Vladislav Shpilevoy 2018-07-16 12:27 ` Kirill Shcherbatov 2018-07-12 16:34 ` [tarantool-patches] [PATCH v1 2/2] sql: fixed possible leak in sqlite3EndTable Kirill Shcherbatov 2018-07-13 10:26 ` [tarantool-patches] " Vladislav Shpilevoy 2018-07-13 16:05 ` Kirill Shcherbatov 2018-07-13 10:26 ` [tarantool-patches] Re: [PATCH v1 0/2] sql: restrict nullable action definitions Vladislav Shpilevoy 2018-07-16 12:28 ` [tarantool-patches] [PATCH v1 2/4] sql: refactor sqlite3AddNotNull function Kirill Shcherbatov 2018-07-16 13:41 ` [tarantool-patches] " Vladislav Shpilevoy 2018-07-16 12:28 ` [tarantool-patches] [PATCH v1 4/4] sql: get rid of Column structure Kirill Shcherbatov 2018-07-16 13:40 ` [tarantool-patches] " Vladislav Shpilevoy 2018-07-16 16:33 ` Kirill Shcherbatov 2018-07-17 9:32 ` Vladislav Shpilevoy 2018-07-17 14:08 ` Kirill Shcherbatov 2018-07-17 22:01 ` Vladislav Shpilevoy 2018-07-18 7:25 ` Kirill Shcherbatov [this message] 2018-07-18 8:04 ` Vladislav Shpilevoy 2018-07-18 16:41 ` n.pettik
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=55a87410-6db0-f51f-722a-6e9cb8795341@tarantool.org \ --to=kshcherbatov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=v.shpilevoy@tarantool.org \ --subject='[tarantool-patches] Re: [PATCH v1 4/4] sql: get rid of Column structure' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox