Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 31D43200BF3 for ; Thu, 5 Jan 2017 21:18:05 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 306AF160B33; Thu, 5 Jan 2017 20:18:05 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7A442160B26 for ; Thu, 5 Jan 2017 21:18:04 +0100 (CET) Received: (qmail 18275 invoked by uid 500); 5 Jan 2017 20:17:58 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 18169 invoked by uid 99); 5 Jan 2017 20:17:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jan 2017 20:17:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6D49D2C1F56 for ; Thu, 5 Jan 2017 20:17:58 +0000 (UTC) Date: Thu, 5 Jan 2017 20:17:58 +0000 (UTC) From: "Samarth Jain (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-2565) Store data for immutable tables in single KeyValue MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 05 Jan 2017 20:18:05 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-2565?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15802411#comment-15802411 ] Samarth Jain commented on PHOENIX-2565: --------------------------------------- If we go by the bitset approach where we don't store offset for missing or null columns, then figuring out where the bytes for a column are stored in the packed cell would no longer be a O(1) operation. For finding every column, on an average, we would have to go through half of the bitset to figure out the bytes for a column. We could possibly optimize that though by caching the bitset/offset information. This would come in handy especially when we have to evaluate multiple ArrayColumnExpressions against the packed cell. The caching would have to be done at a higher level though (parent of ArrayColumnExpression?). The cache would be built when evaluating the first ArrayColumnExpression. Subsequent evaluate() calls won't then have to compute where the bytes are. > Store data for immutable tables in single KeyValue > -------------------------------------------------- > > Key: PHOENIX-2565 > URL: https://issues.apache.org/jira/browse/PHOENIX-2565 > Project: Phoenix > Issue Type: Improvement > Reporter: James Taylor > Assignee: Thomas D'Silva > Attachments: PHOENIX-2565-v2.patch, PHOENIX-2565-wip.patch, PHOENIX-2565.patch > > > Since an immutable table (i.e. declared with IMMUTABLE_ROWS=true) will never update a column value, it'd be more efficient to store all column values for a row in a single KeyValue. We could use the existing format we have for variable length arrays. > For backward compatibility, we'd need to support the current mechanism. Also, you'd no longer be allowed to transition an existing table to/from being immutable. I think the best approach would be to introduce a new IMMUTABLE keyword and use it like this: > {code} > CREATE IMMUTABLE TABLE ... > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)