From issues-return-3330-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Wed Dec 12 00:40: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 3A17F180671 for ; Wed, 12 Dec 2018 00:40:04 +0100 (CET) Received: (qmail 1506 invoked by uid 500); 11 Dec 2018 23:40:03 -0000 Mailing-List: contact issues-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 issues@phoenix.apache.org Received: (qmail 1497 invoked by uid 99); 11 Dec 2018 23:40:03 -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, 11 Dec 2018 23:40:03 +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 E324BC1DF4 for ; Tue, 11 Dec 2018 23:40:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.501 X-Spam-Level: X-Spam-Status: No, score=-109.501 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id CRjWs3J__ypi for ; Tue, 11 Dec 2018 23:40:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 4B9C25F39B for ; Tue, 11 Dec 2018 23:40: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 86648E02EB for ; Tue, 11 Dec 2018 23:40: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 4291D25300 for ; Tue, 11 Dec 2018 23:40:00 +0000 (UTC) Date: Tue, 11 Dec 2018 23:40:00 +0000 (UTC) From: "Lars Hofhansl (JIRA)" To: issues@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4845) Support using Row Value Constructors in OFFSET clause to support paging in tables where the sort order of PK columns varies 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-4845?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 718200#comment-16718200 ]=20 Lars Hofhansl commented on PHOENIX-4845: ---------------------------------------- Right. We'd need a way to store and pass small-scan state around - which ac= tually would be a nice HBase feature :) > Support using Row Value Constructors in OFFSET clause to support paging i= n tables where the sort order of PK columns varies > -------------------------------------------------------------------------= -------------------------------------------------- > > Key: PHOENIX-4845 > URL: https://issues.apache.org/jira/browse/PHOENIX-4845 > Project: Phoenix > Issue Type: New Feature > Reporter: Thomas D'Silva > Priority: Major > Labels: DESC, SFDC > Attachments: PHOENIX-offset.txt > > > RVCs along with the LIMIT clause are useful for efficiently paging throug= h rows (see [http://phoenix.apache.org/paged.html]).=C2=A0This works well i= f the pk columns are sorted ascending, we can always use the > operator to = query for the next batch of row.=20 > However if the PK of a table is (A=C2=A0 DESC, B DESC) we cannot use the = following query to page through the data > {code:java} > SELECT * FROM TABLE WHERE (A, B) > (?, ?) ORDER BY A DESC, B DESC LIMIT 2= 0 > {code} > Since the rows are sorted by A desc and then by B descending we need chan= ge the comparison order > {code:java} > SELECT * FROM TABLE WHERE (A, B) < (?, ?) ORDER BY A DESC, B DESC LIMIT 2= 0 > {code} > If the PK of a table contains columns with mixed sort order for eg (A=C2= =A0 DESC, B) then we cannot use RVC to page through data.=20 > If we supported using RVCs in the offset clause we could use the offset t= o set the start row of the scan. Clients would not have to have logic to de= termine the comparison operator. This would also support paging through dat= a for tables where the PK columns are sorted in mixed order.=20 > {code:java} > SELECT * FROM TABLE ORDER BY A DESC, B LIMIT 20 OFFSET (?,?) > {code} > We would only allow using the offset if the rows are ordered by the sort = order of the PK columns. > =C2=A0 > FYI [~jfernando_sfdc] -- This message was sent by Atlassian JIRA (v7.6.3#76005)