Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B7D995A1 for ; Fri, 20 Apr 2012 05:35:59 +0000 (UTC) Received: (qmail 69426 invoked by uid 500); 20 Apr 2012 05:35:59 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 69398 invoked by uid 500); 20 Apr 2012 05:35:59 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 69377 invoked by uid 99); 20 Apr 2012 05:35:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2012 05:35:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2012 05:35:57 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8EB813A4C1B for ; Fri, 20 Apr 2012 05:35:37 +0000 (UTC) Date: Fri, 20 Apr 2012 05:35:37 +0000 (UTC) From: "Jonathan Ellis (Issue Comment Edited) (JIRA)" To: commits@cassandra.apache.org Message-ID: <724836607.8725.1334900137586.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <465686629.7650.1334871640028.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Issue Comment Edited] (CASSANDRA-4175) Reduce memory (and disk) space requirements with a column name/id map MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CASSANDRA-4175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13258030#comment-13258030 ] Jonathan Ellis edited comment on CASSANDRA-4175 at 4/20/12 5:34 AM: -------------------------------------------------------------------- identityHashCode is basically the object's location in memory, so it's not going to be the same on different nodes. (So it would work for approach 2, I suppose, but I'd rather use a simple int counter.) was (Author: jbellis): Hashcode just isn't designed to be collision-resistant; it prioritizes speed. Even with a better (from the standpoint of collisions) general-purpose hash like Murmur, 32bits is just too small. The smallest cryptographic hash I know of is md5, and ballooning to 128bits puts a serious crimp in the potential savings here. > Reduce memory (and disk) space requirements with a column name/id map > --------------------------------------------------------------------- > > Key: CASSANDRA-4175 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4175 > Project: Cassandra > Issue Type: Improvement > Reporter: Jonathan Ellis > Fix For: 1.2 > > > We spend a lot of memory on column names, both transiently (during reads) and more permanently (in the row cache). Compression mitigates this on disk but not on the heap. > The overhead is significant for typical small column values, e.g., ints. > Even though we intern once we get to the memtable, this affects writes too via very high allocation rates in the young generation, hence more GC activity. > Now that CQL3 provides us some guarantees that column names must be defined before they are inserted, we could create a map of (say) 32-bit int column id, to names, and use that internally right up until we return a resultset to the client. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira