[ https://issues.apache.org/jira/browse/DERBY-6942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071383#comment-16071383 ]
Harshvardhan Gupta edited comment on DERBY-6942 at 7/1/17 8:02 PM: ------------------------------------------------------------------- I was able to solve my problem after spending some more time on it. Attached are two files, one is the patch which uses additional statistics for null count values to generate accurate selectivity estimates. It build upon DERBY-6940 and makes changes to FromBaseTable.java and TableDescriptor.java to consume the additional statistics. The other file is the optimizer trace after application of the patch. The extra qualifier selectivity is changed to 0.5 representing the fraction of null values in my dataset during last statistics update. I also tested with multi column indexes and I was able to successfully obtain accurate selectivity estimates for queries of this class. I encourage you to download the patch and test the behaviour. Some more work is required to integrate minimum and maximum column values which were also collected as part of additional statistics. was (Author: harshvardhan145): I was able to solve my problem after spending some more time on it. Attached are two files, one is the patch which uses additional statistics for null count values to generate accurate selectivity estimates. It build upon DERBY-6940 and makes changes to FromBaseTable.java and TableDescriptor.java to consume the additional statistics. The other file is the optimizer trace after application of the patch. The extra qualifier selectivity is changed to 0.5 representing the fraction of null values on my dataset during last statistics update. I also tested with multi column indexes and I was able to successfully obtain accurate selectivity estimates for queries if this class. I encourage you to download the patch and test the behaviour. Some more work is required to integrate minimum and maximum column values which were also collected as part of additional statistics. > Utilise additional statistics for selectivity estimates. > -------------------------------------------------------- > > Key: DERBY-6942 > URL: https://issues.apache.org/jira/browse/DERBY-6942 > Project: Derby > Issue Type: Sub-task > Components: SQL > Reporter: Harshvardhan Gupta > Assignee: Harshvardhan Gupta > Priority: Minor > Attachments: DERBY-6942.diff, z12.txt, z13.txt > > -- This message was sent by Atlassian JIRA (v6.4.14#64029)