You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Vladimir Ozerov (JIRA)" <ji...@apache.org> on 2017/08/14 14:10:00 UTC
[jira] [Created] (IGNITE-6054) SQL: Add option to store primitive
keys in plain form for CREATE TABLE
Vladimir Ozerov created IGNITE-6054:
---------------------------------------
Summary: 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: Bug
Components: sql
Affects Versions: 2.1
Reporter: Vladimir Ozerov
Fix For: 2.2
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)