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

Knut Anders Hatlen commented on DERBY-269:
------------------------------------------

Thanks Mamta! I'm fine with the changes and with keeping the internal syntax 
from the previous patches.

Mike,
It looks to me as if the cardinality is the number of unique values, so I think 
the cardinality of a unique index is equal to its row count (for the full key, 
that is).
You're right that we can't short circuit it if we have a multi-column index. I 
don't know if it's worth the extra complexity to short circuit the A,B,C case, 
since we'd have to scan the entire index anyway. For a single-column unique 
index it sounds like a good idea, though.

> Provide some way to update index cardinality statistics (e.g. reimplement 
> update statistics)
> --------------------------------------------------------------------------------------------
>
>                 Key: DERBY-269
>                 URL: https://issues.apache.org/jira/browse/DERBY-269
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.0.2.0, 10.0.2.1, 10.1.1.0, 10.2.2.0, 10.3.1.4
>            Reporter: Stan Bradbury
>            Assignee: Mamta A. Satoor
>         Attachments: DERBY269_update_statistics_svndiff_ver1.txt, 
> DERBY269_update_statistics_svndiff_ver2.txt, 
> DERBY269_update_statistics_svnstat_ver1.txt, 
> DERBY269_update_statistics_svnstat_ver2.txt
>
>
> Performance problems are being reported that can be resolved by updating the 
> cardinality statistics used by the optimizer.  Currently the only time the 
> statistics are guaranteed to be an up-to-date is when the index is first 
> created on a fully populated table.  This is most easily accomplished on an 
> existing table by using the command: 
>    alter table <table-name> compress [sequential]  
> Compress table is an I/O intensive task.  A better way to achieve this would 
> be to re-enable parser support for the 'update statistics' command or 
> re-implement the update in some other fashion.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to