You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/08/03 15:57:04 UTC
[jira] [Commented] (TRAFODION-1423) Indexes on trafodion should be
created in aligned row format by default
[ https://issues.apache.org/jira/browse/TRAFODION-1423?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14651878#comment-14651878 ]
ASF GitHub Bot commented on TRAFODION-1423:
-------------------------------------------
Github user sureshsubbiah commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/37#discussion_r36086954
--- Diff: core/sql/generator/GenRelScan.cpp ---
@@ -2203,10 +2203,46 @@ short HbaseAccess::codeGen(Generator * generator)
ExpTupleDesc::SQLMX_KEY_FORMAT);
const ValueIdList &retColumnList = retColRefSet_;
+ // Always get the index name -- it will be the base tablename for
+ // primary access if it is trafodion table.
+ char * tablename = NULL;
+ char * snapshotName = NULL;
+ LatestSnpSupportEnum latestSnpSupport= latest_snp_supported;
+ if ((getTableDesc()->getNATable()->isHbaseRowTable()) ||
+ (getTableDesc()->getNATable()->isHbaseCellTable()))
+ {
+ tablename =
+ space->AllocateAndCopyToAlignedSpace(
+ GenGetQualifiedName(getTableName().getQualifiedNameObj().getObjectName()), 0);
+ latestSnpSupport = latest_snp_not_trafodion_table;
+ }
+ else
+ {
+ if (getIndexDesc() && getIndexDesc()->getNAFileSet())
+ {
+ tablename = space->AllocateAndCopyToAlignedSpace(GenGetQualifiedName(getIndexDesc()->getNAFileSet()->getFileSetName()), 0);
+ if (getIndexDesc()->isClusteringIndex())
+ {
+ //base table
+ snapshotName = (char*)getTableDesc()->getNATable()->getSnapshotName() ;
+ if (snapshotName == NULL)
+ latestSnpSupport = latest_snp_no_snapshot_available;
+ }
+ else
+ latestSnpSupport = latest_snp_index_table;
--- End diff --
Do we support the case where the base table has no snapshot defined on it but an index on the table does have a snapshot?
> Indexes on trafodion should be created in aligned row format by default
> -----------------------------------------------------------------------
>
> Key: TRAFODION-1423
> URL: https://issues.apache.org/jira/browse/TRAFODION-1423
> Project: Apache Trafodion
> Issue Type: Improvement
> Components: sql-cmp, sql-cmu
> Affects Versions: 2.0-incubating
> Reporter: Selvaganesan Govindarajan
> Assignee: Selvaganesan Govindarajan
>
> Currently indexes are created with the same row format as the table. However, indexes can be created in aligned row format independent of the table because the columns in the index table doesn't have any other column other than salt, index columns, and primary key of the table. These column values constitute the rowid. Index rows are always deleted and inserted and are never updated. Hence, it goes well to create index in aligned row format. In addition, index in aligned row format has the following advantages:
> - Reduced storage space for the index
> - Reduced block cache and memstore space at runtime
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)