Unable to select all data from a table in SQL Server
I'm facing something really strange.
In a table (T) containning 400 000 records.
When selecting this:
select top 150000 * from 开发者_高级运维T
I got answer in 3 secondes
but if I take them all, I stop the request after 5 minutes without having the result.
Any idea about this problem ?
thx,
Pit
The main area to look for the cause are:
- Disk IO
- Cache hit ratio
- A block on a page of the table because of other processes ( Add WITH(NOLOCK) table hint to your query)
- Network bottleneck (if going to client off the db server)
I agree with Arman that the indexes are not needed and each page of the table must be read.
精彩评论