db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harshvardhan Gupta (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6938) Obtain cardinality estimates and true estimates for base tables as well as for intermediate results for queries involving multiple joins.
Date Wed, 14 Jun 2017 07:41:00 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16048798#comment-16048798
] 

Harshvardhan Gupta commented on DERBY-6938:
-------------------------------------------

The specific approach I am thinking is to keep the minimum and maximum value of columns and
number of NULL values in statistics, this could be utilised in operators such as (< , >
, <=, >=, IS NOT NULL, NULL) etc.

For example, lets say we have a int column and the minimum and maximum value is 20 and 100
respectively. Then for a query predicate on that column with the condition that >=80 should
ideally return 25% of all columns. This approach obviously assumes an uniform distribution
but should be good to get started with. We should be able to make it more efficient by taking
into account distribution later on.

>  Obtain cardinality estimates and true estimates for base tables as well as for intermediate
results for queries involving multiple joins. 
> -------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6938
>                 URL: https://issues.apache.org/jira/browse/DERBY-6938
>             Project: Derby
>          Issue Type: Sub-task
>          Components: SQL
>            Reporter: Harshvardhan Gupta
>            Assignee: Harshvardhan Gupta
>         Attachments: explain.txt
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message