You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tony Anecito <ad...@yahoo.com> on 2013/07/05 04:36:09 UTC

How to build indexes?

Hi All,

I updated a table with a secondary index. I discovered using CLI describe that the index was not built.

How do I build an index after I have altered an existing table with data?

I looked at nodetool and cli and saw no command that had the word build index associated with it. And most of the postings I have found so far cover creating an index but not building it or verifying the index was built.

Thanks,
-Tony

Re: How to build indexes?

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks,
Apparently for 1.2.5 it did not build automatically. Diescribe shows index[] which indicates it was not built.
 
I will try the nodetool command. I dd not see it in the hep list though.
 
Best Regards,
-Tony

From: Sylvain Lebresne <sy...@datastax.com>
To: "user@cassandra.apache.org" <us...@cassandra.apache.org>; Tony Anecito <ad...@yahoo.com> 
Sent: Friday, July 5, 2013 3:12 AM
Subject: Re: How to build indexes?



Creating a secondary index will trigger the build of that index automatically.

However, that built is done asynchronously and can take some time if you have lots of existing data to index. To know when that building is done, you can check the nodes log for an entry looking like "Index build of <index_name> complete" (you can also check the IndexInfo system table (SELECT * FROM system."IndexInfo", the quotes matter for backward compatibility reason), a row for the new index will appear in that table when it's built).

You can also force a rebuild however if you want using nodetool rebuild_index.




On Fri, Jul 5, 2013 at 4:36 AM, Tony Anecito <ad...@yahoo.com> wrote:

Hi All,
>
>I updated a table with a secondary index. I discovered using CLI describe that the index was not built.
>
>How do I build an index after I have altered an existing table with data?
>
>I looked at nodetool and cli and saw no command that had the word build index associated with it. And most of the postings I have found so far cover creating an index but not building it or verifying the index was built.
>
>Thanks,
>-Tony
>
>
>

Re: How to build indexes?

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks Sylvain,

I am getting errors in nodetool. Strange it wants -ks (which I assume is keyspace) then when I try I get following error.

C:\servers\apache-cassandra-1.2.5\bin>nodetool rebuild_index -host localhost -ks video -cf videos
Starting NodeTool
Unrecognized option: -ks
usage: java org.apache.cassandra.tools.NodeCmd --host <arg> <command>

What am I doing wrong? Is there good documentation somewhere with command line example?

Thanks,
-Tony




________________________________
 From: Sylvain Lebresne <sy...@datastax.com>
To: "user@cassandra.apache.org" <us...@cassandra.apache.org>; Tony Anecito <ad...@yahoo.com> 
Sent: Friday, July 5, 2013 3:12 AM
Subject: Re: How to build indexes?
 


Creating a secondary index will trigger the build of that index automatically.

However, that built is done asynchronously and can take some time if you have lots of existing data to index. To know when that building is done, you can check the nodes log for an entry looking like "Index build of <index_name> complete" (you can also check the IndexInfo system table (SELECT * FROM system."IndexInfo", the quotes matter for backward compatibility reason), a row for the new index will appear in that table when it's built).

You can also force a rebuild however if you want using nodetool rebuild_index.




On Fri, Jul 5, 2013 at 4:36 AM, Tony Anecito <ad...@yahoo.com> wrote:

Hi All,
>
>I updated a table with a secondary index. I discovered using CLI describe that the index was not built.
>
>How do I build an index after I have altered an existing table with data?
>
>I looked at nodetool and cli and saw no command that had the word build index associated with it. And most of the postings I have found so far cover creating an index but not building it or verifying the index was built.
>
>Thanks,
>-Tony
>
>
>

Re: How to build indexes?

Posted by Sylvain Lebresne <sy...@datastax.com>.
Creating a secondary index will trigger the build of that index
automatically.

However, that built is done asynchronously and can take some time if you
have lots of existing data to index. To know when that building is done,
you can check the nodes log for an entry looking like "Index build of
<index_name> complete" (you can also check the IndexInfo system table
(SELECT * FROM system."IndexInfo", the quotes matter for backward
compatibility reason), a row for the new index will appear in that table
when it's built).

You can also force a rebuild however if you want using nodetool
rebuild_index.



On Fri, Jul 5, 2013 at 4:36 AM, Tony Anecito <ad...@yahoo.com> wrote:

> Hi All,
>
> I updated a table with a secondary index. I discovered using CLI describe
> that the index was not built.
>
> How do I build an index after I have altered an existing table with data?
>
> I looked at nodetool and cli and saw no command that had the word build
> index associated with it. And most of the postings I have found so far
> cover creating an index but not building it or verifying the index was
> built.
>
> Thanks,
> -Tony
>
>