Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9B69417649 for ; Thu, 6 Nov 2014 16:28:34 +0000 (UTC) Received: (qmail 64355 invoked by uid 500); 6 Nov 2014 16:28:34 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 64322 invoked by uid 500); 6 Nov 2014 16:28:34 -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 64311 invoked by uid 99); 6 Nov 2014 16:28:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Nov 2014 16:28:34 +0000 Date: Thu, 6 Nov 2014 16:28:33 +0000 (UTC) From: "T Jake Luciani (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CASSANDRA-8270) Allow sub slices for composites MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-8270?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] T Jake Luciani updated CASSANDRA-8270: -------------------------------------- Description: For some queries with clustering keys it would be helpful to allow server side to avoid processing things you will simply filter out. Example schema: {code} create TABLE foo (a text, b int, c int, d int, primary key(a, b, c)); insert into foo (a, b, c, d ) VALUES ( 'key', 2, 3, 4); insert into foo (a, b, c, d ) VALUES ( 'key', 2, 4, 4); insert into foo (a, b, c, d ) VALUES ( 'key', 3, 3, 4); insert into foo (a, b, c, d ) VALUES ( 'key', 3, 4, 4); {code} {code} select count(*) from foo where a = 'key' and b = 2 and c > 3; --return 1 select count(*) from foo where a = 'key' and b > 2 and c > 3; --error select count(*) from foo where a = 'key' and c > 3; --error {code} The first query is only possible because our slices only allow a fixed prefix but if we extended slices to include slices we could effectively request for: {noformat} b(2,*) c(3,*) b(*,*) c(3,*) {noformat} was: For some queries with clustering keys it would be helpful to allow server side to avoid processing things you will simply filter out. Example schema: {code} create TABLE foo (a text, b int, c int, d int, primary key(a, b, c)); insert into foo (a, b, c, d ) VALUES ( 'key', 2, 3, 4); insert into foo (a, b, c, d ) VALUES ( 'key', 2, 4, 4); insert into foo (a, b, c, d ) VALUES ( 'key', 3, 3, 4); insert into foo (a, b, c, d ) VALUES ( 'key', 3, 4, 4); {code} {code} select count(*) from foo where a = 'key' and b = 2 and c > 3; --return 1 select count(*) from foo where a = 'key' and b > 2 and c > 3; --error select count(*) from foo where a = 'key' and c > 3; --error {code} The first query is only possible because our slices only allow a fixed prefix but if we extended slices to include slices we could effectively request for: {noformat} b(2,*) c (3,*) b (*,*) c (3,*) {noformat} > Allow sub slices for composites > ------------------------------- > > Key: CASSANDRA-8270 > URL: https://issues.apache.org/jira/browse/CASSANDRA-8270 > Project: Cassandra > Issue Type: Improvement > Reporter: T Jake Luciani > Priority: Minor > > For some queries with clustering keys it would be helpful to allow server side to avoid processing things you will simply filter out. > Example schema: > {code} > create TABLE foo (a text, b int, c int, d int, primary key(a, b, c)); > insert into foo (a, b, c, d ) VALUES ( 'key', 2, 3, 4); > insert into foo (a, b, c, d ) VALUES ( 'key', 2, 4, 4); > insert into foo (a, b, c, d ) VALUES ( 'key', 3, 3, 4); > insert into foo (a, b, c, d ) VALUES ( 'key', 3, 4, 4); > {code} > {code} > select count(*) from foo where a = 'key' and b = 2 and c > 3; --return 1 > select count(*) from foo where a = 'key' and b > 2 and c > 3; --error > select count(*) from foo where a = 'key' and c > 3; --error > {code} > The first query is only possible because our slices only allow a fixed prefix but if we extended slices to include slices we could effectively request for: > {noformat} > b(2,*) c(3,*) > b(*,*) c(3,*) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)