Home » SQL & PL/SQL » SQL & PL/SQL » Cardinality Examples
Cardinality Examples [message #229675] Mon, 09 April 2007 12:15 Go to next message
wtolentino
Messages: 196
Registered: March 2005
Senior Member
can anyone provide me some simple examples or explanations of cardinality in oracle. thanks.
Re: Cardinality Examples [message #229676 is a reply to message #229675] Mon, 09 April 2007 12:24 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Unwilling or incapable to RTFM?

http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#sthref1021

Re: Cardinality Examples [message #229683 is a reply to message #229676] Mon, 09 April 2007 13:08 Go to previous messageGo to next message
wtolentino
Messages: 196
Registered: March 2005
Senior Member
thank you for providing the link. in your own how do you express or define a cardinality?
Re: Cardinality Examples [message #229686 is a reply to message #229675] Mon, 09 April 2007 13:15 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
I do NOT believe in reinventing the wheel.
http://en.wikipedia.org/wiki/Cardinality
You're On Your Own (YOYO)!
Re: Cardinality Examples [message #229692 is a reply to message #229683] Mon, 09 April 2007 13:33 Go to previous message
William Robertson
Messages: 1640
Registered: August 2003
Location: London, UK
Senior Member
http://www.google.com/search?q=define%3Acardinality

In Oracle it seems to depend on the context. It means either the total number of rows (in a table, returned by a step of an execution plan etc), or else the number of distinct values. The CARDINALITY() SQL function itself returns the number of elements in a nested table.

SELECT CARDINALITY(test.tt)
     , CARDINALITY(SET(test.tt))
FROM   ( SELECT INTEGER_TT(1,1,1,1,5) AS tt FROM dual ) test;

CARDINALITY(TEST.TT) CARDINALITY(SET(TEST.TT))
-------------------- -------------------------
                   5                         2

1 row selected.


From the Data Warehousing Guide Glossary:

Cardinality
From an OLTP perspective, this refers to the number of rows in a table. From a data warehousing perspective, this typically refers to the number of distinct values in a column. For most data warehouse DBAs, a more important issue is the degree of cardinality.


Previous Topic: Getting Error Encountered the symbol "@" when expecting one when excuting procedure in ora
Next Topic: Merge CSV files
Goto Forum:
  


Current Time: Sun Dec 11 06:14:54 CST 2016

Total time taken to generate the page: 0.08323 seconds