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 9DBE5200BB7 for ; Wed, 26 Oct 2016 02:09:00 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9C53D160AD8; Wed, 26 Oct 2016 00:09: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 1C58A160B02 for ; Wed, 26 Oct 2016 02:08:59 +0200 (CEST) Received: (qmail 71834 invoked by uid 500); 26 Oct 2016 00:08:58 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 71437 invoked by uid 99); 26 Oct 2016 00:08:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Oct 2016 00:08:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 9FEE32C2A69 for ; Wed, 26 Oct 2016 00:08:58 +0000 (UTC) Date: Wed, 26 Oct 2016 00:08:58 +0000 (UTC) From: "James Taylor (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PHOENIX-3328) Optimize ORed leading pk column range comparisions to SkipScan MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 26 Oct 2016 00:09:00 -0000 [ https://issues.apache.org/jira/browse/PHOENIX-3328?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] James Taylor updated PHOENIX-3328: ---------------------------------- Fix Version/s: (was: 4.8.2) > Optimize ORed leading pk column range comparisions to SkipScan > -------------------------------------------------------------- > > Key: PHOENIX-3328 > URL: https://issues.apache.org/jira/browse/PHOENIX-3328 > Project: Phoenix > Issue Type: Bug > Reporter: William Yang > Assignee: William Yang > Priority: Minor > Fix For: 4.9.0 > > Attachments: PHOENIX-3328.patch > > > {code:sql} > create table t1 (pk integer primary key, a integer); > create table t2 (pk1 integer not null, pk2 integer not null, a integer constraint pk primary key (pk1, pk2)); > explain select * from t1 where (pk > 10 and pk < 20) or (pk > 30 and pk < 40); > explain select * from t2 where (pk1 > 10 and pk1 < 20) or (pk1 > 30 and pk1 < 40); > {code} > The first SELECT statement will use skip scan filter for two ranges, so as the second one. But actually the WhereOptimizer failed doing so and using a full table scan instead. This happens for tables have multi PK columns. -- This message was sent by Atlassian JIRA (v6.3.4#6332)