Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 07D06830E for ; Thu, 18 Aug 2011 15:43:13 +0000 (UTC) Received: (qmail 43333 invoked by uid 500); 18 Aug 2011 15:43:10 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 43268 invoked by uid 500); 18 Aug 2011 15:43:10 -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 43258 invoked by uid 99); 18 Aug 2011 15:43:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2011 15:43:10 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dan.kuebrich@gmail.com designates 74.125.82.172 as permitted sender) Received: from [74.125.82.172] (HELO mail-wy0-f172.google.com) (74.125.82.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Aug 2011 15:43:02 +0000 Received: by wyg8 with SMTP id 8so1748680wyg.31 for ; Thu, 18 Aug 2011 08:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=CSjlbM1fcMxjQK+Zr3bMn9mgLoBjAqgmBNvj0/85zAk=; b=wA3dFlBnmFay7o+wPuBWA/1N7gCMiMbjvgs0XH/6BdUciyD7OSY/gAbTP+PKmcmoxy 71vTNrFFmZmeYieOIWrJaIxr3Zb/dq5RWN/CNevShl9mtHRS52Ts+Iv3CH11dRWAuBUW Cqwy+Z+mCIiUFmrndjsuJxutNyOzY/m952sf0= Received: by 10.216.160.66 with SMTP id t44mr5485227wek.56.1313682162168; Thu, 18 Aug 2011 08:42:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.38.6 with HTTP; Thu, 18 Aug 2011 08:42:22 -0700 (PDT) In-Reply-To: References: <6F1D6A69-8CB5-4B3C-AAC1-C67DE391E53F@thelastpickle.com> From: Dan Kuebrich Date: Thu, 18 Aug 2011 11:42:22 -0400 Message-ID: Subject: Re: dropping secondary indexes To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e64c1ca09fb5b504aac97649 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64c1ca09fb5b504aac97649 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable https://issues.apache.org/jira/browse/CASSANDRA-3054 On Wed, Aug 17, 2011 at 7:13 PM, aaron morton wrot= e: > ooo, didn't know there was a drop index statement. > > I got the same result, the Antlr grammar seems to say it's a valid > identifier (not that I have much Antlr foo)=85 > > > Identifier > : (Letter | Alnum) (Alnum | '_' | '-' )* > > fragment > Letter > : 'a'..'z' > | 'A'..'Z' > ; > > fragment > Digit > : '0'..'9' > ; > > fragment > Alnum > : Letter > | Digit > ; > > Could you raise a bug for it. > > In the mean time I was able to drop the index as follows=85 > > create column family Standard4 > with comparator =3D BytesType > and column_metadata =3D > [{ > column_name : 617070, > validation_class : IntegerType, > index_type : 0, > index_name : IdxName}, > { > column_name : 'other name', > validation_class : LongType > }]; > > update column family Standard4 > with comparator =3D BytesType > and column_metadata =3D > [ > { > column_name : 'other name', > validation_class : LongType > }]; > > > Cheers > > ----------------- > Aaron Morton > Freelance Cassandra Developer > @aaronmorton > http://www.thelastpickle.com > > On 18/08/2011, at 3:16 AM, Dan Kuebrich wrote: > > Thanks, Aaron! In terms of dropping stuff from the CLI, I tried to re-dr= op > the remaining built column index and get the following error message. I > wonder if there's some sort of parser bug related to numeric vs alpha > tokens. The column name below is col2 from the show keyspace dump earlie= r > in the thread, though I understand the hex value should be used for dropp= ing > columns. > > [default@Tracelytics] use MyKeyspace; > Authenticated to keyspace: MyKeyspace > [default@Tracelytics] drop index on MyCF.617070; > Syntax error at position 22: mismatched input '617070' expecting Identifi= er > > CLI drop index worked for all the columns with hex letters in them, and i= n > fact adding an alpha char here changes the message: > > [default@Tracelytics] drop index on MyCF.617070x; > Column '617070x' definition was not found in ColumnFamily 'MyCF'. > [default@Tracelytics] drop index on Rollups.col2; > Column 'col2' definition was not found in ColumnFamily 'MyCF'. > > > On Tue, Aug 16, 2011 at 7:29 PM, aaron morton wr= ote: > >> > I think I've dropped all the indexes on a CF, but I see traces of them >> in the CLI output of show keyspaces. I see a few validators left behind= , >> and one "built index". (output below) >> What process did you use to drop the indexes ? You need to use update >> column family and not include the column meta data. >> >> > 1. Is there a better way to check schema for indexes? >> Thats the way. You can also look in JConsole. If you see things that see= m >> odd check the cluster agrees on the schema using describe cluster in the >> CLI. >> >> > 3. Do validators incur any performance penalties? They're no longer >> necessary (the named columns are not even written anymore). >> >> There is a minor over head, but only if the named column is updated. >> >> Cheers >> >> ----------------- >> Aaron Morton >> Freelance Cassandra Developer >> @aaronmorton >> http://www.thelastpickle.com >> >> On 17/08/2011, at 2:12 AM, Dan Kuebrich wrote: >> >> > I think I've dropped all the indexes on a CF, but I see traces of them >> in the CLI output of show keyspaces. I see a few validators left behind= , >> and one "built index". (output below) >> > >> > 1. Is there a better way to check schema for indexes? >> > 2. I can't drop the "built" one so I assume they're all gone? If so, >> what is the remaining index listing? >> > 3. Do validators incur any performance penalties? They're no longer >> necessary (the named columns are not even written anymore). >> > >> > ColumnFamily: MyCF >> > Key Validation Class: org.apache.cassandra.db.marshal.BytesType >> > Default column value validator: >> org.apache.cassandra.db.marshal.BytesType >> > Columns sorted by: org.apache.cassandra.db.marshal.BytesType >> > Row cache size / save period in seconds: 2000.0/0 >> > Key cache size / save period in seconds: 200000.0/14400 >> > Memtable thresholds: 1.1203125/1440/239 (millions of >> ops/minutes/MB) >> > GC grace seconds: 864000 >> > Compaction min/max thresholds: 4/32 >> > Read repair chance: 1.0 >> > Replicate on write: false >> > Built indexes: [MyCF.MyCF_617070_idx] >> > Column Metadata: >> > Column Name: col1 (6167656e74) >> > Validation Class: org.apache.cassandra.db.marshal.UTF8Type >> > Column Name: col2 (617070) >> > Validation Class: org.apache.cassandra.db.marshal.UTF8Type >> > Index Name: MyCF_617070_idx >> > Index Type: KEYS >> > Column Name: col3 (686f7374) >> > Validation Class: org.apache.cassandra.db.marshal.UTF8Type >> > Column Name: col4 (686f73745f6964) >> > Validation Class: org.apache.cassandra.db.marshal.UTF8Type >> > Column Name: col5 (696d706c) >> > Validation Class: org.apache.cassandra.db.marshal.UTF8Type >> > Column Name: col6 (706572696f64) >> > Validation Class: org.apache.cassandra.db.marshal.UTF8Type >> >> > > --0016e64c1ca09fb5b504aac97649 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable https://is= sues.apache.org/jira/browse/CASSANDRA-3054

On Wed, Aug 17, 2011 at 7:13 PM, aaron morton <<= a href=3D"mailto:aaron@thelastpickle.com">aaron@thelastpickle.com> wrote:
ooo, di= dn't know there was a drop index statement.=A0

I got= the same result, the Antlr grammar seems to say it's a valid identifie= r (not that I have much Antlr foo)=85


Identifier
=A0 =A0 : (Letter |= Alnum) (Alnum | '_' | '-' )*

frag= ment
Letter
=A0 =A0 : 'a'..'z'=A0
=
=A0 =A0 | 'A'..'Z'
=A0 =A0 ;

fragment
Digit
= =A0 =A0 : '0'..'9'
=A0 =A0 ;

=
fragment
Alnum
=A0 =A0 : Letter
=A0 =A0 = | Digit
=A0 =A0 ;

Could you raise a bug for it.=A0

In the mean time I was able to drop the index as follows= =85

create column family Standard4
= =A0 =A0 with comparator =3D BytesType
=A0 =A0 and column_metadata =3D
=A0 =A0 [{
=A0 =A0= =A0 =A0 column_name : 617070,
=A0 =A0 =A0 =A0 validation_class := IntegerType,
=A0 =A0 =A0 =A0 index_type : 0,
=A0 =A0 = =A0 =A0 index_name : IdxName},
=A0 =A0 {
=A0 =A0 =A0 =A0 column_name : 'other name',
=A0 =A0 =A0 =A0 validation_class : LongType
=A0 =A0 }];

=A0 =A0 update column family Standard4
=A0 =A0 with comparator =3D BytesType
=A0 =A0 and column_metadata =3D
=A0 =A0 [
=A0 =A0 = {
=A0 =A0 =A0 =A0 column_name : 'other name',
= =A0 =A0 =A0 =A0 validation_class : LongType
=A0 =A0 }];
=A0 =A0=A0

Cheers
=A0
-----------------
Aaron Morton
Freelance Cass= andra Developer
@aaronmorton

On 18/08/2011, at 3:1= 6 AM, Dan Kuebrich wrote:

Thanks, Aaron!= =A0In terms of dropping stuff from the CLI, I tried to re-drop the remaini= ng built column index and get the following error message. =A0I wonder if t= here's some sort of parser bug related to numeric vs alpha tokens. =A0T= he column name below is col2 from the show keyspace dump earlier in the thr= ead, though I understand the hex value should be used for dropping columns.=

[default@Tracelytics] use MyKeyspace;
Authent= icated to keyspace: MyKeyspace
[default@Tracelytics] drop index o= n MyCF.617070;=A0
Syntax error at position 22: mismatched input &= #39;617070' expecting Identifier

CLI drop index worked for all the columns with hex lett= ers in them, and in fact adding an alpha char here changes the message:

[default@Tracelytics] drop index on MyCF.617070x;
Column '617070x' definition was not found in ColumnFamily '= ;MyCF'.
[default@Tracelytics] drop index on Rollups.col2;
Column 'col2' definition was not found in ColumnFamily '= MyCF'.


On Tue, Aug 16, 2011 at 7:29 = PM, aaron morton <aaron@thelastpickle.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin-top:0px;margin-right:0px;m= argin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:= rgb(204, 204, 204);border-left-style:solid;padding-left:1ex">
> I think I've dropped all the indexes on a CF, but I see trace= s of them in the CLI output of show keyspaces. =A0I see a few validators le= ft behind, and one "built index". =A0(output below)
What process did you use to drop the indexes ? You need to use =A0upd= ate column family and not include the column meta data.

> 1. Is there a better way to check schema for indexes?
Thats the way. You can also look in JConsole. If you see things that = seem odd check the cluster agrees on the schema using describe cluster in t= he CLI.

> 3. Do validators incur any performance penalties? =A0They're no lo= nger necessary (the named columns are not even written anymore).

There is a minor over head, but only if the named column is updated.<= br>
Cheers

-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thel= astpickle.com

On 17/08/2011, at 2:12 AM, Dan Kuebrich wrote:

> I think I've dropped all the indexes on a CF, but I see traces of = them in the CLI output of show keyspaces. =A0I see a few validators left be= hind, and one "built index". =A0(output below)
>
> 1. Is there a better way to check schema for indexes?
> 2. I can't drop the "built" one so I assume they're = all gone? =A0If so, what is the remaining index listing?
> 3. Do validators incur any performance penalties? =A0They're no lo= nger necessary (the named columns are not even written anymore).
>
> =A0 =A0 ColumnFamily: MyCF
> =A0 =A0 =A0 Key Validation Class: org.apache.cassandra.db.marshal.Byte= sType
> =A0 =A0 =A0 Default column value validator: org.apache.cassandra.db.ma= rshal.BytesType
> =A0 =A0 =A0 Columns sorted by: org.apache.cassandra.db.marshal.BytesTy= pe
> =A0 =A0 =A0 Row cache size / save period in seconds: 2000.0/0
> =A0 =A0 =A0 Key cache size / save period in seconds: 200000.0/14400 > =A0 =A0 =A0 Memtable thresholds: 1.1203125/1440/239 (millions of ops/m= inutes/MB)
> =A0 =A0 =A0 GC grace seconds: 864000
> =A0 =A0 =A0 Compaction min/max thresholds: 4/32
> =A0 =A0 =A0 Read repair chance: 1.0
> =A0 =A0 =A0 Replicate on write: false
> =A0 =A0 =A0 Built indexes: [MyCF.MyCF_617070_idx]
> =A0 =A0 =A0 Column Metadata:
> =A0 =A0 =A0 =A0 Column Name: col1 (6167656e74)
> =A0 =A0 =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.= UTF8Type
> =A0 =A0 =A0 =A0 Column Name: col2 (617070)
> =A0 =A0 =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.= UTF8Type
> =A0 =A0 =A0 =A0 =A0 Index Name: MyCF_617070_idx
> =A0 =A0 =A0 =A0 =A0 Index Type: KEYS
> =A0 =A0 =A0 =A0 Column Name: col3 (686f7374)
> =A0 =A0 =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.= UTF8Type
> =A0 =A0 =A0 =A0 Column Name: col4 (686f73745f6964)
> =A0 =A0 =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.= UTF8Type
> =A0 =A0 =A0 =A0 Column Name: col5 (696d706c)
> =A0 =A0 =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.= UTF8Type
> =A0 =A0 =A0 =A0 Column Name: col6 (706572696f64)
> =A0 =A0 =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.= UTF8Type




--0016e64c1ca09fb5b504aac97649--