From dev-return-50698-archive-asf-public=cust-asf.ponee.io@phoenix.apache.org Sun Apr 8 19:15:03 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 45294180638 for ; Sun, 8 Apr 2018 19:15:03 +0200 (CEST) Received: (qmail 59495 invoked by uid 500); 8 Apr 2018 17:15: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 59484 invoked by uid 99); 8 Apr 2018 17:15:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Apr 2018 17:15:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id B1325C0EFB for ; Sun, 8 Apr 2018 17:15:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 4DUYqWRwz5LI for ; Sun, 8 Apr 2018 17:15: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 E8E385F1E7 for ; Sun, 8 Apr 2018 17:15:00 +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 81A5AE0287 for ; Sun, 8 Apr 2018 17:15: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 3EDFE241C4 for ; Sun, 8 Apr 2018 17:15:00 +0000 (UTC) Date: Sun, 8 Apr 2018 17:15:00 +0000 (UTC) From: "Andrew Purtell (JIRA)" To: dev@phoenix.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (PHOENIX-2715) Query Log 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-2715?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16= 429814#comment-16429814 ]=20 Andrew Purtell commented on PHOENIX-2715: ----------------------------------------- Random thoughts on trying to use this in a production setting * Cool to have a LogWriter that puts the log into a table, so the log itse= lf can be queried. Powerful. How about a LogWriter that just emits to Java = logging as well. HBase+Phoenix systems throw off a ton of this type of logg= ing, so we already need a solution for managing it, for which query log wou= ld just be a new subset. Many places may want their log search solution to = be based on something else (Splunk, Elastic, Solr, etc.) * If not=C2=A0an alternate implementation of LogWriter, at least a better = factoring. Make LogWriter abstract or an interface. That should be quickly = accomplished. * What happens if query logging becomes too expensive? We can turn it all = the way on and all the way off. Can we have a knob for probabilistic sampli= ng? This is really easy to implement. Add one config parameter, a float or = double,=C2=A0one that can ideally be changed dynamically. Call it something= like QUERY_LOG_SAMPLE_RATE (not a great name but whatever) In the code whe= re you go to do the query logging, add a conditional \{{if (ThreadLocalRand= om.getCurrent().getDouble() <=3D getConfig(QUERY_LOG_SAMPLE_RATE))}} . Easy= . So if logging 100% of queries is too expensive (at QUERY_LOG_SAMPLE_RATE = =3D 1.0), we can try logging 50% of them (at QUERY_LOG_SAMPLE_RATE =3D 0.5)= , or 10% of them (at QUERY_LOG_SAMPLE_RATE =3D 0.1), or 1% of them (at QUER= Y_LOG_SAMPLE_RATE =3D 0.01).=C2=A0 > Query Log > --------- > > Key: PHOENIX-2715 > URL: https://issues.apache.org/jira/browse/PHOENIX-2715 > Project: Phoenix > Issue Type: New Feature > Reporter: Nick Dimiduk > Assignee: Ankit Singhal > Priority: Major > Attachments: PHOENIX-2715.patch, PHOENIX-2715_master.patch, PHOEN= IX-2715_master_V1.patch > > > One useful feature of other database systems is the query log. It allows = the DBA to review the queries run, who's run them, time taken, &c. This ser= ves both as an audit and also as a source of "ground truth" for performance= optimization. For instance, which columns should be indexed. It may also s= erve as the foundation for automated performance recommendations/actions. > What queries are being run is the first piece. Have this data tied into t= racing results and perhaps client-side metrics (PHOENIX-1819) becomes very = useful. > This might take the form of clients writing data to a new system table, b= ut other implementation suggestions are welcome. -- This message was sent by Atlassian JIRA (v7.6.3#76005)