From dev-return-49581-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Tue Feb 20 08:26:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id CB290180654 for ; Tue, 20 Feb 2018 08:26:03 +0100 (CET) Received: (qmail 51374 invoked by uid 500); 20 Feb 2018 07:26:02 -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 51363 invoked by uid 99); 20 Feb 2018 07:26:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2018 07:26:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4BBBDC0145 for ; Tue, 20 Feb 2018 07:26:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id bDjL5KwQM33S for ; Tue, 20 Feb 2018 07:26:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 493305F1F3 for ; Tue, 20 Feb 2018 07:26:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D21E3E031B for ; Tue, 20 Feb 2018 07:26:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 2D95F2255B for ; Tue, 20 Feb 2018 07:26:00 +0000 (UTC) Date: Tue, 20 Feb 2018 07:26:00 +0000 (UTC) From: "Maryann Xue (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4288) Indexes not used when ordering by primary key MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PHOENIX-4288?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 369773#comment-16369773 ]=20 Maryann Xue commented on PHOENIX-4288: -------------------------------------- Thank you, [~rajeshbabu], for reminding me. 5.x branch has now caught=C2=A0= up=C2=A0with all my recent check-ins. > Indexes not used when ordering by primary key > --------------------------------------------- > > Key: PHOENIX-4288 > URL: https://issues.apache.org/jira/browse/PHOENIX-4288 > Project: Phoenix > Issue Type: Sub-task > Reporter: Marcin Januszkiewicz > Assignee: Maryann Xue > Priority: Major > Labels: CostBasedOptimization > Fix For: 4.14.0 > > Attachments: PHOENIX-4288.patch > > > We have a table > CREATE TABLE t ( > rowkey VARCHAR PRIMARY KEY, > c1 VARCHAR, > c2 VARCHAR > ) > which we want to query by doing partial matches on c1, and keep the order= ing of the source table: > SELECT rowkey, c1, c2 FROM t where c1 LIKE 'X0%' ORDER BY rowkey; > We expect most queries to select a small subset of the table, so we creat= e an index to speed up searches: > CREATE LOCAL INDEX t_c1_ix ON t (c1); > However, this index will not be used since Phoenix will always choose not= to resort the data. > In our actual use case, adding index hints is not a practical solution. > See also discussion at: > https://lists.apache.org/thread.html/26ab58288eb811d2f074c3f89067163d341e= 5531fb581f3b2486cf43@%3Cuser.phoenix.apache.org%3E -- This message was sent by Atlassian JIRA (v7.6.3#76005)