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 4E106200BD8 for ; Wed, 7 Dec 2016 08:53:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4CC2E160B26; Wed, 7 Dec 2016 07:53: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 94010160B0A for ; Wed, 7 Dec 2016 08:52:59 +0100 (CET) Received: (qmail 51317 invoked by uid 500); 7 Dec 2016 07:52: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 51306 invoked by uid 99); 7 Dec 2016 07:52:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Dec 2016 07:52:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 79F152C03E0 for ; Wed, 7 Dec 2016 07:52:58 +0000 (UTC) Date: Wed, 7 Dec 2016 07:52:58 +0000 (UTC) From: "Corentin Chary (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-12910) SASI: calculatePrimary() always returns null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 07 Dec 2016 07:53:00 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15728043#comment-15728043 ] Corentin Chary commented on CASSANDRA-12910: -------------------------------------------- That's totally right. Thanks for the detailed explanation. > SASI: calculatePrimary() always returns null > -------------------------------------------- > > Key: CASSANDRA-12910 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12910 > Project: Cassandra > Issue Type: Bug > Components: sasi > Reporter: Corentin Chary > Assignee: Corentin Chary > Priority: Minor > Fix For: 3.x > > Attachments: 0002-sasi-fix-calculatePrimary.patch > > > While investigating performance issues with SASI (https://github.com/criteo/biggraphite/issues/174 if you want to know more) I ended finding calculatePrimary() in QueryController.java which apparently should return the "primary index". > It lacks documentation, and I'm unsure what the "primary index" should be, but apparently this function never returns one because primaryIndexes.size() is always 0. > https://github.com/apache/cassandra/blob/81f6c784ce967fadb6ed7f58de1328e713eaf53c/src/java/org/apache/cassandra/index/sasi/plan/QueryController.java#L237 > I'm unsure if the proper fix is checking if the collection is empty or reversing the operator (selecting the index with higher cardinality versus the one with lower cardinality). -- This message was sent by Atlassian JIRA (v6.3.4#6332)