1. Symptom
- In the SYSTAB system view, the 'count' column only has a row count for system tables.
According to IQ manual, count column means the number of rows in the table or materialized view.
Column name | Data type | Description |
count | UNSIGNED BIGINT | The number of rows in the table or materialized view. This value is updated during each successful checkpoint. This number is used to optimize database access. The count is always 0 for a non-materialized view or remote table. |
2. Test with ASA and Base Table in IQ.
Here are steps to test.
1) ASA Table Test in IQ
1-1) create table test_asa (c1 int) in system; //ASA Area
1-2) insert test_asa values(1);
commit;
1-3) checkpoint;
1-4) select table_name, count from systab where table_name = 'test_asa';
[Results]
table_name,count
'test_asa',1
2) BASE Table Test in IQ
2-1) create table test_base (c1 int);
2-2) insert test_base values(1);
commit;
2-3) checkpoint;
2-4) select table_name, count from systab where table_name = 'test_base';
[Results]
table_name,count
'test_base',0
3. Cause
- The table here in the count column doesn't mean the base table.
It means that the tables are located in ASA Area.
The column "count" is an attribute of a SQL Anywhere object.
[SYSTAB in ASA]
- http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sqlanywhere.12.0.0/dbreference/views-s-407928012.html
** The only way to get IQ table rowcount is using "select count(*)" in IQ.
===
Gi-Sung Jang