Home

Getting Started

Utilities

Indexing

Omnidex

Development

Tutorials

Quick Links

 

Appendix

Cardinality

Environment Catalog

UPDATE STATISTICS

 

Appendix

 

 

With respect to databases, there are two distinct types of cardinality: table cardinality and column cardinality.

  • Table cardinality is the number of rows in a table.
  • Column cardinality is the number of unique values in a column.

Although not a requirement, DISC recommends including the cardinality values in the Omnidex environment catalog table and column definitions. Omnidex can use these values to determine the best method to use to process a query against multiple tables.

For example:

The products table is a parent table with a primary key that has a column cardinality of 10,000. This means it has 10,000 unique product codes.

The orders table is a child table with 10,000,000 rows. This means it has a table cardinality of 10,000,000.

SELECT O.PRODUCT_CODE, O.CUSTOMER_NO, O.STATUS
FROM PRODUCTS P, ORDERS O
WHERE P.PRODUCT_CODE=O.PRODUCT_CODE
AND P.PRODUCT_NAME = 'PRINTER'

The Omnidex utility ODXSQL, can automatically determine the table and column cardinality for all tables defined in the Omnidex environment catalog, using the UPDATE STATISTICS command. Dependent on the frequency of data updates, the cardinality values should be updated periodically.

 

Top