Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 80612 invoked from network); 24 Feb 2011 23:28:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Feb 2011 23:28:07 -0000 Received: (qmail 48597 invoked by uid 500); 24 Feb 2011 23:28:05 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 48537 invoked by uid 500); 24 Feb 2011 23:28:04 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 48529 invoked by uid 99); 24 Feb 2011 23:28:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 23:28:04 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rsiemens@greatergood.com designates 206.253.208.224 as permitted sender) Received: from [206.253.208.224] (HELO mail.yss4.com) (206.253.208.224) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Feb 2011 23:27:55 +0000 Received: from dhcp173tech.greatergood.net (fireboxoffice.greatergood.net [192.168.5.8]) by mail.yss4.com (Postfix) with ESMTPSA id 0E66A2632; Thu, 24 Feb 2011 15:27:34 -0800 (PST) From: Ron Siemens Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: Homebrew CF-indexing vs secondary indexing Date: Thu, 24 Feb 2011 15:27:33 -0800 Message-Id: <0A5181F8-03A3-45D9-ACFC-65AB58659E61@greatergood.com> To: user@cassandra.apache.org, hector-users@googlegroups.com Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org I am doing some experimenting with indexing. My data CF has about 25000 = rows around 1KB each. I set up a special column of boolean value to use = as the secondary index. I also created my own index in a separate CF = where each index is one row and the column names are the data keys. The implementation is in Hector 0.7.0-27, and run options are -Xms64m = -Xmx256m Below are two sample runs, the first using the secondary index with = IndexedSlicesQuery. The second using my homebrew CF index and = createSliceQuery for the index followed by createMultigetSliceQuery for = the data. The timing output is from result.getExecutionTimeMicro(), but = it looks like ms. I'm not sure if its purpose is as I'm assuming and = using here. By the way, THS is just the same of the index, which is a = subset of 7293 rows of the some 25000. Anyway, it looks like the custom index does significantly better. Is = this expected? Why? I expected them to be about the same, having read = the secondary index also uses a column family internally. But more = disconcerting, the secondary index implementation runs out of space, = while the custom one runs along with only a few notable slow downs. = Both implementations are using the same = column-processing/deserialization code so that doesn't seem to be to = blame. What gives? Ron Sample run: Secondary index. DEBUG Retrieved THS / 7293 rows, in 2012 ms DEBUG Retrieved THS / 7293 rows, in 1956 ms DEBUG Retrieved THS / 7293 rows, in 1843 ms DEBUG Retrieved THS / 7293 rows, in 2295 ms DEBUG Retrieved THS / 7293 rows, in 1828 ms DEBUG Retrieved THS / 7293 rows, in 1740 ms DEBUG Retrieved THS / 7293 rows, in 1899 ms DEBUG Retrieved THS / 7293 rows, in 2266 ms DEBUG Retrieved THS / 7293 rows, in 2310 ms DEBUG Retrieved THS / 7293 rows, in 2395 ms DEBUG Retrieved THS / 7293 rows, in 2829 ms DEBUG Retrieved THS / 7293 rows, in 2725 ms DEBUG Retrieved THS / 7293 rows, in 3752 Exception in thread "main" = java.lang.OutOfMemoryError: Java heap space at java.nio.CharBuffer.wrap(CharBuffer.java:350) at java.nio.CharBuffer.wrap(CharBuffer.java:373) at = java.lang.StringCoding$StringDecoder.decode(StringCoding.java:138) at java.lang.StringCoding.decode(StringCoding.java:173) at java.lang.String.(String.java:443) at = me.prettyprint.cassandra.serializers.StringSerializer.fromByteBuffer(Strin= gSerializer.java:40) at = me.prettyprint.cassandra.serializers.StringSerializer.fromByteBuffer(Strin= gSerializer.java:13) at = me.prettyprint.cassandra.serializers.AbstractSerializer.fromBytes(Abstract= Serializer.java:38) at = me.prettyprint.cassandra.model.HColumnImpl.(HColumnImpl.java:48) at = me.prettyprint.cassandra.model.ColumnSliceImpl.(ColumnSliceImpl.java= :27) at = me.prettyprint.cassandra.model.RowImpl.(RowImpl.java:32) at = me.prettyprint.cassandra.model.RowsImpl.(RowsImpl.java:33) at = me.prettyprint.cassandra.model.OrderedRowsImpl.(OrderedRowsImpl.java= :30) at = me.prettyprint.cassandra.model.IndexedSlicesQuery$1.doInKeyspace(IndexedSl= icesQuery.java:143) at = me.prettyprint.cassandra.model.IndexedSlicesQuery$1.doInKeyspace(IndexedSl= icesQuery.java:131) at = me.prettyprint.cassandra.model.KeyspaceOperationCallback.doInKeyspaceAndMe= asure(KeyspaceOperationCallback.java:20) at = me.prettyprint.cassandra.model.ExecutingKeyspace.doExecute(ExecutingKeyspa= ce.java:85) at = me.prettyprint.cassandra.model.IndexedSlicesQuery.execute(IndexedSlicesQue= ry.java:130) Sample run: Homebrew CF-indexing DEBUG CFIndex THS / 7293 read in 262 ms DEBUG Retrieved THS / 7293 rows, in 1579 ms DEBUG CFIndex THS / 7293 read in 44 ms DEBUG Retrieved THS / 7293 rows, in 1771 ms DEBUG CFIndex THS / 7293 read in 38 ms DEBUG Retrieved THS / 7293 rows, in 1275 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1364 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1590 ms DEBUG CFIndex THS / 7293 read in 22 ms DEBUG Retrieved THS / 7293 rows, in 1118 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1280 ms DEBUG CFIndex THS / 7293 read in 21 ms DEBUG Retrieved THS / 7293 rows, in 1466 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1589 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1772 ms DEBUG CFIndex THS / 7293 read in 20 ms DEBUG Retrieved THS / 7293 rows, in 1660 ms DEBUG CFIndex THS / 7293 read in 20 ms DEBUG Retrieved THS / 7293 rows, in 1931 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1626 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1750 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1557 ms DEBUG CFIndex THS / 7293 read in 19 ms DEBUG Retrieved THS / 7293 rows, in 9409 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1709 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1750 ms DEBUG CFIndex THS / 7293 read in 45 ms DEBUG Retrieved THS / 7293 rows, in 1629 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1596 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1879 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1597 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1662 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9362 ms DEBUG CFIndex THS / 7293 read in 26 ms DEBUG Retrieved THS / 7293 rows, in 1900 ms DEBUG CFIndex THS / 7293 read in 22 ms DEBUG Retrieved THS / 7293 rows, in 1972 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1631 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1579 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1606 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1582 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1784 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9522 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1628 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1551 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1627 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1539 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1563 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1623 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1804 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9010 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1444 ms DEBUG CFIndex THS / 7293 read in 41 ms DEBUG Retrieved THS / 7293 rows, in 1528 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1451 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1558 ms DEBUG CFIndex THS / 7293 read in 16 ms DEBUG Retrieved THS / 7293 rows, in 1585 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1659 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1708 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9195 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1590 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1572 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1582 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1568 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1689 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1810 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1556 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 8922 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1549 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1782 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1824 ms DEBUG CFIndex THS / 7293 read in 16 ms DEBUG Retrieved THS / 7293 rows, in 1579 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1531 ms DEBUG CFIndex THS / 7293 read in 22 ms DEBUG Retrieved THS / 7293 rows, in 1576 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1533 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9533 ms DEBUG CFIndex THS / 7293 read in 48 ms DEBUG Retrieved THS / 7293 rows, in 1544 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1467 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1557 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1714 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1888 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1588 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1612 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9529 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1653 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1813 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1650 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1572 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1646 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1566 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1727 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9480 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1577 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1529 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1566 ms DEBUG CFIndex THS / 7293 read in 18 ms DEBUG Retrieved THS / 7293 rows, in 1555 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1570 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1550 ms DEBUG CFIndex THS / 7293 read in 19 ms DEBUG Retrieved THS / 7293 rows, in 1455 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 10318 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1566 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1576 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1572 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1654 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1578 ms DEBUG CFIndex THS / 7293 read in 19 ms DEBUG Retrieved THS / 7293 rows, in 1571 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1710 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 9903 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1571 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1596 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1556 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1607 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1655 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1882 ms DEBUG CFIndex THS / 7293 read in 19 ms DEBUG Retrieved THS / 7293 rows, in 1535 ms DEBUG CFIndex THS / 7293 read in 19 ms DEBUG Retrieved THS / 7293 rows, in 8502 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1538 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1578 ms DEBUG CFIndex THS / 7293 read in 24 ms DEBUG Retrieved THS / 7293 rows, in 1540 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1561 ms DEBUG CFIndex THS / 7293 read in 56 ms DEBUG Retrieved THS / 7293 rows, in 1745 ms DEBUG CFIndex THS / 7293 read in 17 ms DEBUG Retrieved THS / 7293 rows, in 1454 ms