cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Corentin Chary (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-12915) SASI: Index intersection with an empty range really inefficient
Date Wed, 08 Mar 2017 09:38:38 GMT


Corentin Chary commented on CASSANDRA-12915:

{code} this(range == null ? null : range.min, range == null ? null : range.max, range == null
? 0 : range.count);{code}

I think it would be better not to make the assumption that null range == empty range. Mostly
because it isn't treated the same way in add()

{code} If either range is empty. Empty range is a subrange of (overlaps with) any range.{code}

That's not how intersection usually works, shouldn't the result of an empty range intersection
with anything be an empty range ? (which means that an empty range overlaps with nothing)

> SASI: Index intersection with an empty range really inefficient
> ---------------------------------------------------------------
>                 Key: CASSANDRA-12915
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: sasi
>            Reporter: Corentin Chary
>            Assignee: Corentin Chary
>             Fix For: 3.11.x, 4.x
> It looks like and be pretty inefficient in some cases.
Let's take the following query:
> SELECT data FROM table WHERE index1 = 'foo' AND index2 = 'bar';
> In this case:
> * index1 = 'foo' will match 2 items
> * index2 = 'bar' will match ~300k items
> On my setup, the query will take ~1 sec, most of the time being spent in disk.TokenTree.getTokenAt().
> if I patch RangeIntersectionIterator so that it doesn't try to do the intersection (and
effectively only use 'index1') the query will run in a few tenth of milliseconds.
> I see multiple solutions for that:
> * Add a static thresold to avoid the use of the index for the intersection when we know
it will be slow. Probably when the range size factor is very small and the range size is big.
> * CASSANDRA-10765

This message was sent by Atlassian JIRA

View raw message