Row count

Documents SQL Server 2005 and 2008 databases.

Moderators: JonathanWatts, David Atkinson, Michelle Taylor

Row count

Postby George Palacean » Wed Jan 14, 2009 3:45 pm

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
George Palacean
 
Posts: 19
Joined: Wed Jan 14, 2009 3:26 pm

Postby alex.weatherall » Thu Jan 15, 2009 5:04 pm

The only thing I would say about including row count value on the tables page is that this information should be optional on the tables list (and the table page for that matter ) - like the SQL Script option.

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
alex.weatherall
 
Posts: 42
Joined: Tue Nov 29, 2005 1:32 pm

Postby Linda Hawksworth » Wed Mar 25, 2009 11:27 am

The ability to turn off the row count altogether or modify how it is calculated has already bene logged as a feature request in our tracking system and will be considered for the next release of SQL Doc although we have no timescales for this at present.
Linda Hawksworth
 
Posts: 192
Joined: Mon Jun 25, 2007 11:32 am


Return to SQL Doc 2

Who is online

Users browsing this forum: No registered users and 0 guests