Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Statistics and Group by's

Status
Not open for further replies.

Liam1

Programmer
Nov 7, 2002
43
0
0
GB
Hello,

Is there a large benfit to be had collecting Stats on Group by columns.

If so, can I use a composed stats (Field_1, Field_2 etc)?

I don't want to create an INDEX unless necessary - I doubt this would even help?

I do this insert and group by 11 times due to spool issues, and our databse is running so slow at the minute I cannot test it!

Thanks,

Liam.
 
It's the best to have stats on the group by columns without any additional columns.

Those stats won't make the aggregate step run faster, but the optimizer knows better about the expected number of rows, so there maybe a different/better plan with stats.

Dieter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top