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 3A960200B57 for ; Mon, 27 Jun 2016 17:38:54 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 395DE160A5B; Mon, 27 Jun 2016 15:38:54 +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 86705160A62 for ; Mon, 27 Jun 2016 17:38:53 +0200 (CEST) Received: (qmail 45150 invoked by uid 500); 27 Jun 2016 15:38:52 -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 45121 invoked by uid 99); 27 Jun 2016 15:38:52 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Jun 2016 15:38:52 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 436292C1F6D for ; Mon, 27 Jun 2016 15:38:52 +0000 (UTC) Date: Mon, 27 Jun 2016 15:38:52 +0000 (UTC) From: "Sam Tunnicliffe (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-10214) Enable index selection to be overridden on a per query basis MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 27 Jun 2016 15:38:54 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-10214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sam Tunnicliffe updated CASSANDRA-10214: ---------------------------------------- Assignee: (was: Sam Tunnicliffe) > Enable index selection to be overridden on a per query basis > ------------------------------------------------------------ > > Key: CASSANDRA-10214 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10214 > Project: Cassandra > Issue Type: New Feature > Components: CQL > Reporter: Sam Tunnicliffe > Fix For: 3.x > > > (Broken out of CASSANDRA-10124) > We could add a {{USING INDEX }} clause to {{SELECT}} syntax to force the choice of index and bypass the usual index selection mechanism. > {code} > CREATE TABLE ks.t1(k int, v1 int, v2 int, PRIMARY KEY (k)); > CREATE INDEX v1_idx ON ks.t1(v1); > CREATE INDEX v2_idx ON ks.t1(v2); > CREATE CUSTOM INDEX v1_v2_idx ON ks.t1(v1, v2) USING 'com.foo.bar.CustomMultiColumnIndex'; > # Override internal index selection mechanism > SELECT * FROM ks.t1 WHERE v1=0 AND v2=0 USING INDEX v1_idx; > SELECT * FROM ks.t1 WHERE v1=0 AND v2=0 USING INDEX v2_idx; > SELECT * FROM ks.t1 WHERE v1=0 AND v2=0 USING INDEX v1_v2_idx; > {code} > This is in some ways similar to [index hinting|http://docs.oracle.com/cd/B19306_01/server.102/b14211/hintsref.htm#CHDJDIAH] in Oracle. > edit: fixed typo's (missing INDEX in the USING clauses) -- This message was sent by Atlassian JIRA (v6.3.4#6332)