Solved

How to locate number of rows without firing select count(*) query

Posted on 2012-03-20
2
230 Views
Last Modified: 2012-03-20
Hi,
I have 4-5 massive BI tables where the records are in hundreds of millions. I can't fire select count(*) as that will take next 4-5 hours to return results from these tables. The server is already overused.

I can see the query is estimating the execution plan & rows. Is there is an internal optimizer table from where I can get apprx number of rows at each table?


Thanks
0
Comment
Question by:crazywolf2010
2 Comments
 
LVL 25

Expert Comment

by:jogos
ID: 37742085
In the DMV sys.dm_db_index_physical_stats and there the record_count, but read comment on this at
http://msdn.microsoft.com/en-us/library/ms188917.aspx
0
 
LVL 10

Accepted Solution

by:
sqlservr earned 500 total points
ID: 37742132
sp_spaceused 'tabelname'
resutls gives, rows, reserves space, data space, index space
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now