Re: Secondary Indexes C* 3.0

2018-02-22 Thread Akash Gangil
To provide more context, I was going through this
https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html#useWhenIndex__highCardCol

On Thu, Feb 22, 2018 at 9:35 AM, Akash Gangil  wrote:

> Hi,
>
> I was wondering if there are recommendations around the cardinality of
> secondary indexes.
>
> As I understand an index on a column with many distinct values will be
> inefficient. Is it because the index would only direct me to the specfic
> sstable, but then it sequentially searches for the target records? So a
> wide range of the index could lead to a lot of ssltable options to traverse?
>
> Though what's unclear is what the recommended (or benchmarked?) limit, is
> it the index must have 100 distinct values, or can it have upto 1000 or
> 5 distinct values?
>
> thanks!
>
>
>
>
> --
> Akash
>



-- 
Akash


Re: Secondary Indexes C* 3.0

2018-02-22 Thread DuyHai Doan
Read this: http://www.doanduyhai.com/blog/?p=13191




On Thu, Feb 22, 2018 at 6:44 PM, Akash Gangil  wrote:

> To provide more context, I was going through this
> https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html#
> useWhenIndex__highCardCol
>
> On Thu, Feb 22, 2018 at 9:35 AM, Akash Gangil 
> wrote:
>
>> Hi,
>>
>> I was wondering if there are recommendations around the cardinality of
>> secondary indexes.
>>
>> As I understand an index on a column with many distinct values will be
>> inefficient. Is it because the index would only direct me to the specfic
>> sstable, but then it sequentially searches for the target records? So a
>> wide range of the index could lead to a lot of ssltable options to traverse?
>>
>> Though what's unclear is what the recommended (or benchmarked?) limit, is
>> it the index must have 100 distinct values, or can it have upto 1000 or
>> 5 distinct values?
>>
>> thanks!
>>
>>
>>
>>
>> --
>> Akash
>>
>
>
>
> --
> Akash
>


RE: Secondary Indexes C* 3.0

2018-02-23 Thread Jacques-Henri Berthemet
A very interesting and detailed article, thank you DuyHai. I think this should 
be part of general Cassandra documentation.

--
Jacques-Henri Berthemet

From: DuyHai Doan [mailto:doanduy...@gmail.com]
Sent: Thursday, February 22, 2018 7:04 PM
To: user 
Subject: Re: Secondary Indexes C* 3.0

Read this: 
http://www.doanduyhai.com/blog/?p=13191<http://www.doanduyhai.com/blog/?p=13191>




On Thu, Feb 22, 2018 at 6:44 PM, Akash Gangil 
mailto:akashg1...@gmail.com>> wrote:
To provide more context, I was going through this 
https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html#useWhenIndex__highCardCol<https://docs.datastax.com/en/cql/3.3/cql/cql_using/useWhenIndex.html#useWhenIndex__highCardCol>

On Thu, Feb 22, 2018 at 9:35 AM, Akash Gangil 
mailto:akashg1...@gmail.com>> wrote:
Hi,
I was wondering if there are recommendations around the cardinality of 
secondary indexes.

As I understand an index on a column with many distinct values will be 
inefficient. Is it because the index would only direct me to the specfic 
sstable, but then it sequentially searches for the target records? So a wide 
range of the index could lead to a lot of ssltable options to traverse?
Though what's unclear is what the recommended (or benchmarked?) limit, is it 
the index must have 100 distinct values, or can it have upto 1000 or 5 
distinct values?
thanks!




--
Akash


--
Akash