From dev-return-51079-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Fri Apr 20 02:36: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 B52D6180638 for ; Fri, 20 Apr 2018 02:36:03 +0200 (CEST) Received: (qmail 31345 invoked by uid 500); 20 Apr 2018 00:36: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 31332 invoked by uid 99); 20 Apr 2018 00:36:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Apr 2018 00:36:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 2476B1807DB for ; Fri, 20 Apr 2018 00:36:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 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, 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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id G0ezAp1RGlRA for ; Fri, 20 Apr 2018 00:36: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 2E03B5F576 for ; Fri, 20 Apr 2018 00:36: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 8CB7EE0C54 for ; Fri, 20 Apr 2018 00:36: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 2BE80240C6 for ; Fri, 20 Apr 2018 00:36:00 +0000 (UTC) Date: Fri, 20 Apr 2018 00:36:00 +0000 (UTC) From: "Maryann Xue (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-4666) Add a subquery cache that persists beyond the life of a query 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-4666?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 445048#comment-16445048 ]=20 Maryann Xue commented on PHOENIX-4666: -------------------------------------- Thank you for the PR, [~ortutay]! Looking at it now. > Add a subquery cache that persists beyond the life of a query > ------------------------------------------------------------- > > Key: PHOENIX-4666 > URL: https://issues.apache.org/jira/browse/PHOENIX-4666 > Project: Phoenix > Issue Type: Improvement > Reporter: Marcell Ortutay > Assignee: Marcell Ortutay > Priority: Major > > The user list thread for additional context is here: [https://lists.apach= e.org/thread.html/e62a6f5d79bdf7cd238ea79aed8886816d21224d12b0f1fe9b6bb075@= %3Cuser.phoenix.apache.org%3E] > ---- > A Phoenix query may contain expensive subqueries, and moreover those expe= nsive subqueries may be used across multiple different queries. While whole= result caching is possible at the application level, it is not possible to= cache subresults in the application. This can cause bad performance for qu= eries in which the subquery is the most expensive part of the query, and th= e application is powerless to do anything at the query level. It would be g= ood if Phoenix provided a way to cache subquery results, as it would provid= e a significant performance gain. > An illustrative example: > =C2=A0 =C2=A0 SELECT * FROM table1 JOIN (SELECT id_1=C2=A0FROM=C2=A0large= _table WHERE x =3D 10) expensive_result ON table1.id_1 =3D expensive_result= .id_2 AND table1.id_1 =3D \{id} > In this case,=C2=A0the subquery "expensive_result" is expensive to comput= e, but it doesn't change between queries. The rest of the query does becaus= e of the \{id} parameter. This means the application can't cache it, but it= would be good if there was a way to cache=C2=A0expensive_result. > Note that there is currently a coprocessor based "server cache", but the = data in this "cache" is not persisted across queries. It is deleted after a= TTL expires (30sec by default), or when the query completes. > This is issue is fairly high priority for us at 23andMe and we'd be happy= to provide a patch with some guidance from Phoenix maintainers. We are cur= rently putting together a design document for a solution, and we'll post it= to this Jira ticket for review in a few days. -- This message was sent by Atlassian JIRA (v7.6.3#76005)