![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
SQL Server 2008 R2. I've got a database housing a fact table for a data warehouse. It has 722 million rows with 55 columns. Indexes are fully rebuilt, statistics are good, etc. If I do this: |
#3
| |||
| |||
|
|
Jeroen Mostert (jmostert (AT) xs4all (DOT) nl) writes: SQL Server 2008 R2. I've got a database housing a fact table for a data warehouse. It has 722 million rows with 55 columns. Indexes are fully rebuilt, statistics are good, etc. If I do this: And there are no LOB columns, all rows are safely below 8000 bytes in size (so there is no overflow data)? Sorry, forgot to mention that -- it would be a really obvious sinkhole of |
|
What is the average row size? 491 bytes. The optimizer thinks it's 1500, though. Manipulating this |
#4
| |||
| |||
|
|
The only way to work around this, it seems, is to start exploiting parallelism. Executing multiple queries on distinct ranges in the table simultaneously is faster than executing one that reads all of it (the execution plans are the same for all queries regardless of range, and so is their speed, but executing multiple in parallel improves things). |
#5
| |||
| |||
|
|
Jeroen Mostert (jmostert (AT) xs4all (DOT) nl) writes: The only way to work around this, it seems, is to start exploiting parallelism. Executing multiple queries on distinct ranges in the table simultaneously is faster than executing one that reads all of it (the execution plans are the same for all queries regardless of range, and so is their speed, but executing multiple in parallel improves things). And is not the likely explanation for this that the bottleneck is in the client, rather than in SQL Server? Even if BCP is told to write the data to the NUL device, it still has to receive the data, perform the file-system operations etc. So you need multiple clients for speed. Well poTAYto, poTAHto. If there is no client to receive data, you can't run |
#6
| |||
| |||
|
|
Well poTAYto, poTAHto. If there is no client to receive data, you can't run a query that returns a result set, so transferring data between SQL Server and the client is the bottleneck, regardless of who is "to blame". |
|
So yes, I fully agree with you that the client is the bottleneck, but then any interesting client (for my purposes) would be. |
#7
| |||
| |||
|
|
Jeroen Mostert (jmostert (AT) xs4all (DOT) nl) writes: So yes, I fully agree with you that the client is the bottleneck, but then any interesting client (for my purposes) would be. Depending how much data your process returns, as your test indicated. It's a good demonstration that SELECT * just by routine is bad. I will have to admit that I had not thought of it that way. The difference between returning 55 columns and returning 1 is very much |
![]() |
| Thread Tools | |
| Display Modes | |
| |