Re: Query using SeqScan instead of IndexScan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Query using SeqScan instead of IndexScan
Date
Msg-id 18072.1143953169@sss.pgh.pa.us
Whole thread Raw
In response to Re: Query using SeqScan instead of IndexScan  (Mark Kirkwood <markir@paradise.net.nz>)
List pgsql-performance
Mark Kirkwood <markir@paradise.net.nz> writes:
> It is a bit confusing - '(distinct) cardinality' might be a better
> heading for their 'cardinality' column!

The usual mathematical meaning of "cardinality" is "the number of
members in a set".  That isn't real helpful for the point at hand,
because the mathematical definition of a set disallows duplicate
members, so if you're dealing with non-unique values you could argue it
either way about whether to count duplicates or not.  However, I read in
the SQL99 spec (3.1 Definitions)

         d) cardinality (of a value of a collection type): The number of
            elements in that value. Those elements need not necessarily have
            distinct values.

so ... as all too often ... the mysql boys have not got a clue about
standards compliance.  They are using this term in the opposite way
from how the SQL committee uses it.

            regards, tom lane

pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Query using SeqScan instead of IndexScan
Next
From: Ключников А.С.
Date:
Subject: Trigger vs Rule