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 3EBA0200CD2 for ; Thu, 22 Jun 2017 02:59:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3D43C160BD5; Thu, 22 Jun 2017 00:59:04 +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 7BF82160BF0 for ; Thu, 22 Jun 2017 02:59:03 +0200 (CEST) Received: (qmail 48745 invoked by uid 500); 22 Jun 2017 00:59:02 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 48729 invoked by uid 99); 22 Jun 2017 00:59: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; Thu, 22 Jun 2017 00:59: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 F1B4719270B for ; Thu, 22 Jun 2017 00:59:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, 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 0PGhEU3oLjwi for ; Thu, 22 Jun 2017 00:59: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 E0D2B5F6C0 for ; Thu, 22 Jun 2017 00:59: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 689BFE0732 for ; Thu, 22 Jun 2017 00:59: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 20BEC21941 for ; Thu, 22 Jun 2017 00:59:00 +0000 (UTC) Date: Thu, 22 Jun 2017 00:59:00 +0000 (UTC) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-6940) Enhance derby statistics for more accurate selectivity estimates. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 22 Jun 2017 00:59:04 -0000 [ https://issues.apache.org/jira/browse/DERBY-6940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16058547#comment-16058547 ] Bryan Pendleton commented on DERBY-6940: ---------------------------------------- Thanks for the background information, and for the new patch. This all sounds quite promising to me. I will download your updated patch and study it and see how it behaves in my environment. > Enhance derby statistics for more accurate selectivity estimates. > ----------------------------------------------------------------- > > Key: DERBY-6940 > URL: https://issues.apache.org/jira/browse/DERBY-6940 > Project: Derby > Issue Type: Sub-task > Components: SQL > Reporter: Harshvardhan Gupta > Assignee: Harshvardhan Gupta > Priority: Minor > Attachments: DERBY-6940_2.diff, DERBY-6940_3.diff, derby-6940.diff > > > Derby should collect extra statistics during index build time, statistics refresh time which will help optimizer make more precise selectivity estimates and chose better execution paths. > We eventually want to utilize the new statistics to make better selectivity estimates / cost estimates that will help find the best query plan. Currently Derby keeps two type of stats - the total row count and the number of unique values. > We are initially extending the stats to include null count, the minimum value and maximum value associated with each of the columns of an index. This would be useful in selectivity estimates for operators such as [ IS NULL, <, <=, >, >= ] , all of which currently rely on hardwired selectivity estimates. -- This message was sent by Atlassian JIRA (v6.4.14#64029)