Focal Point
[SOLVED] What is the roll of CARDINALITY value in an ACX (access) file.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4427054136

June 12, 2013, 05:17 PM
John W Price
[SOLVED] What is the roll of CARDINALITY value in an ACX (access) file.
I have an ACX File for an MS-SQL table:
SEGNAME=BOOKS, CARDINALITY=564,
TABLENAME=dbo.Books,
CONNECTION=AudioBooks,
KEYS=1, $
FIELD=BOOKID,
AUTOINCREMENT=YES,
START=1000, INCREMENT=1, $
The only definition I have found indicates it is to indicate 1:1, 1:M and M:M relationships. What is a 564 ?

This message has been edited. Last edited by: <Kathryn Henning>,



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com
June 12, 2013, 05:23 PM
j.gross
Number of rows in the table.

I suppose the syntax is there to carry hints that may help the SQL-generator optimize the generated SQL (although I would think the RDBMS is much better at that game).
June 12, 2013, 05:25 PM
David Briars
564 is the number of rows in the table, at the time of the .acx creation.

If WebFOCUS needs to make a decsion, based on the size of the tables, used in a JOIN, this number (CARDINALITY=) will be referenced.

(As a CUBS fan, I've always had an issue with CARDINALITY.)




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
June 12, 2013, 08:01 PM
John W Price
Jack and David,

Thank you.

David, I'm not a baseball fan, but I still got a great laugh from your CUBS vs CARDINALS reference.



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com
June 13, 2013, 09:10 AM
<Emily Duensing>
Hi John,

If memory serves me correctly, I believe it is the number of rows in the table. Depending on the adapter, the optimizer can use that value to make decisions on how to join tables. I seem to remember it should only be used for pretty static tables as you wouldn't want that value in your ACX if the actual value varies -- that could cause some inaccurate decisions by the optimizer.
June 13, 2013, 09:25 AM
Francis Mariani
I've never seen this CARDINALITY attribute, neither have I seen the AUTOINCREMENT, START and INCREMENT attributes - what type of dbms is this acx for?

Cheers,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 13, 2013, 09:35 AM
David Briars
Francis - For us, CARDINALITY is an optional attribute, within our WF adapter for Oracle.

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
June 13, 2013, 11:45 AM
Wep5622
quote:
Originally posted by Emily Duensing:
If memory serves me correctly, I believe it is the number of rows in the table. Depending on the adapter, the optimizer can use that value to make decisions on how to join tables.


I imagine it also gets used in cross-database joins to determine which table to fetch entirely and which to select only specific values from (based on the result set from the smaller table).
For example, if you have a table A and a table B with cardinalities of a billion rows and just 10 respectively, then it's much more efficient to select the 10 rows from table B and apply an IN() clause to table A with those values than it would be to fetch the entirety of table A.

I don't know if WebFOCUS is smart enough to do that. I hope it is.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
June 14, 2013, 08:29 AM
John W Price
Francis,
This is a MS-SQL datsabase table. Autoincrement is the result of the MS-SQL IDENTITY function - which automatically increments the key field when adding new records.



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com