You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/02 12:10:00 UTC

[jira] [Commented] (IGNITE-6054) SQL: Add option to store primitive keys in plain form for CREATE TABLE

    [ https://issues.apache.org/jira/browse/IGNITE-6054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16187911#comment-16187911 ] 

ASF GitHub Bot commented on IGNITE-6054:
----------------------------------------

GitHub user alexpaschenko opened a pull request:

    https://github.com/apache/ignite/pull/2784

    IGNITE-6054

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gridgain/apache-ignite ignite-6054

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/2784.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2784
    
----
commit 5e144a6a9147798e147768062c1dd5a0adcce2a4
Author: Alexander Paschenko <al...@gmail.com>
Date:   2017-09-28T19:22:22Z

    IGNITE-6054 Flat PK

commit dca4ab001908b0a08486425db74d86c2799071bd
Author: Alexander Paschenko <al...@gmail.com>
Date:   2017-09-29T18:32:37Z

    IGNITE-6054 Contd.

commit 6a286e14cb260c17e972c023f6c332914ce45525
Author: Alexander Paschenko <al...@gmail.com>
Date:   2017-10-02T12:08:41Z

    IGNITE-6054 Finished.

----


> SQL: Add option to store primitive keys in plain form for CREATE TABLE
> ----------------------------------------------------------------------
>
>                 Key: IGNITE-6054
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6054
>             Project: Ignite
>          Issue Type: Task
>          Components: sql
>    Affects Versions: 2.1
>            Reporter: Vladimir Ozerov
>            Assignee: Alexander Paschenko
>              Labels: performance
>             Fix For: 2.3
>
>
> Currently we create separate internal type for primary key columns. This is necessary to avoid clashes between keys of the same type within the same caches (ironically, we do not allow multiple dynamic tables per cache).
> The most widely used PK is single-column key of {{Long}} or {{String}} data type. If we store a key plain {{long}}, it will consume 9 bytes. If we store it as an object with long field, it will consume 24 + 9 = 33 bytes. What is worse, in the latter case we will have to copy key object back and forth between page memory and application code many times, while for plain long key we simply do {{Unsafe.getLong}}.
> For this reason, it makes sense to introduce special mode for {{CREATE TABLE}} command, when key will not be wrapped into a class, and will be stored as is. Let's name it {{plainPrimaryKey}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)