Row count
George Palacean
Posts: 28
I noticed that to get the number of rows in a table, SQL Doc runs select count_big (*) from table_name; but that's very slow for large tables and puts huge load on the database, not talking about locking (I think that's the reason it stops after 30 seconds or so...).
Instead, is it possible to take them from the sys.dm_db_partition_stats view (at least for SQL Server 2005 and 2008)? That's how Microsoft's sp_spaceused procedure works, and it's instantaneous.
It would also be very good to have the number of rows for each table on the 'Tables' page (where the list of all tables in the database is), together with their size and/or other info - the page looks too empty and useless now.
Thanks,
George
Instead, is it possible to take them from the sys.dm_db_partition_stats view (at least for SQL Server 2005 and 2008)? That's how Microsoft's sp_spaceused procedure works, and it's instantaneous.
It would also be very good to have the number of rows for each table on the 'Tables' page (where the list of all tables in the database is), together with their size and/or other info - the page looks too empty and useless now.
Thanks,
George
Comments
The reason for this is that some users of SQL Doc are using your product to document databases that have many production instances (e.g. a database that's part of a product rather than in-house database). In these situations rowcount is not relevant (and the documentation is usually generated on non-production databases anyway - so the rowcount is of test or dev data.)
Totally agree about not using count_big(*) for the rowcount. Then again I don't run SQL Doc against a production database.
Thanks,
Alex
TeleWare.com