[Info-ingres] stats on tables with more than 1million rows

Martin Bowes martin.bowes at ndph.ox.ac.uk
Fri Jan 27 13:42:14 UTC 2017


Here is the table with index with sampled stats:

Name:                 fred
Number of rows:       1615057
Storage structure:    btree with unique keys

Column Information:
                                                                  Key  Avg Count
Column Name              Type               Length Nulls Defaults Seq  Per Value
result_id                integer                 4   no      no     1        1.6
sample_id                integer                 4   no      no           unique
test_cid                 integer                 4   no      no

Secondary indexes:
Index Name                       Structure  Keyed On
fred_idx1                        isam       sample_id

And Here is the same table with non-sampled stats (ie. -zs100)

Column Information:
                                                                  Key  Avg Count
Column Name              Type               Length Nulls Defaults Seq  Per Value
result_id                integer                 4   no      no     1     unique
sample_id                integer                 4   no      no              4.4
test_cid                 integer                 4   no      no

The concerning thing here is that the secondary index was flagged as unique in the sampled stats(which it most definitely isn't).

Anyone got any feelings about this?

Marty


From: Martin Bowes [mailto:martin.bowes at ndph.ox.ac.uk]
Sent: 27 January 2017 13:30
To: info-ingres at lists.planetingres.org
Subject: [Info-ingres] stats on tables with more than 1million rows

Hi All,

It appears that optimizedb automatically switches to sampling once a table breaks 1million rows, which is cool.

But now I have a table with unique keys which the stats insist is a non-unique key with an average count per value of 1.6.

Is this a problem?

Martin Bowes

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.planetingres.org/pipermail/info-ingres/attachments/20170127/256b0a6b/attachment.html>


More information about the Info-ingres mailing list