Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3BFD3200BEF for ; Tue, 20 Dec 2016 10:28:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 3ABB6160B1B; Tue, 20 Dec 2016 09:28:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 819CB160B29 for ; Tue, 20 Dec 2016 10:27:59 +0100 (CET) Received: (qmail 11877 invoked by uid 500); 20 Dec 2016 09:27:58 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 11849 invoked by uid 99); 20 Dec 2016 09:27:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Dec 2016 09:27:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7A1412C2A6B for ; Tue, 20 Dec 2016 09:27:58 +0000 (UTC) Date: Tue, 20 Dec 2016 09:27:58 +0000 (UTC) From: "Alex Petrov (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-12915) SASI: Index intersection can be very inefficient MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 20 Dec 2016 09:28:00 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15763743#comment-15763743 ] Alex Petrov commented on CASSANDRA-12915: ----------------------------------------- We've had a short chat on IRC and it was agreed that we'll proceed with the fix for the empty iterator for now. I've suggested several possible alternatives that would help to improve the performance for the use-case right now. [~iksaif] would you like to work on a patch for the empty iterator / empty index result or should I do that? Thank you! > SASI: Index intersection can be very inefficient > ------------------------------------------------ > > Key: CASSANDRA-12915 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12915 > Project: Cassandra > Issue Type: Improvement > Components: sasi > Reporter: Corentin Chary > Fix For: 3.x > > > It looks like RangeIntersectionIterator.java 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 (v6.3.4#6332)