SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Improving the performance of a Big table


Improving the performance of a Big table

Author
Message
Shadab Shah
Shadab Shah
SSC-Addicted
SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)

Group: General Forum Members
Points: 451 Visits: 798
I am newbie in Performance tunning. I am trying my hands on PT.

If you are given a very large table and you are said to improve its performance.
what you be the checklist that you guys would prefer(like what to check first and then
this and then.....)?
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28101 Visits: 13268
Some of the things I'd check:

* are statistics updated?
* is the table indexed? Are they indexed well?
* Are there unnecessary indexes?
* compression
* partitioning


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
HanShi
HanShi
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4480 Visits: 3672
You are not to be improving a table, but you need to improve the queries accessing that table. A table can be optimized by the options Koen has mentioned. But there could be much more gained if you look at the executed queries on that table and try to improve them.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28101 Visits: 13268
HanShi (8/29/2013)
You are not to be improving a table, but you need to improve the queries accessing that table.


And how can you improve a query? By updating statistics, minimize logging, creating indexes, compress the data, partition the table, ... :-) ;-)


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
HanShi
HanShi
SSCarpal Tunnel
SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)SSCarpal Tunnel (4.5K reputation)

Group: General Forum Members
Points: 4480 Visits: 3672
Koen Verbeeck (8/29/2013)

And how can you improve a query? By updating statistics, minimize logging, creating indexes, compress the data, partition the table, ... :-) ;-)


You are absolutely right, but without knowing wich queries are executed, you can't create the needed indexes, choose a proper partition schema, etc. :-P. Sounds like the egg and chicken discussionw00t

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Shadab Shah
Shadab Shah
SSC-Addicted
SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)SSC-Addicted (451 reputation)

Group: General Forum Members
Points: 451 Visits: 798
Koen Verbeeck (8/29/2013)
Some of the things I'd check:

* are statistics updated?
* is the table indexed? Are they indexed well?
* Are there unnecessary indexes?
* compression
* partitioning


I am going through the list provided by You one by one. Regarding compression, Does it really improve the performance !!!! Does it not have a extra overhead to read the content (I am not contrary to your statement , i am just asking :-)) . It would be great if you have some bookmarked link to pros & cons of compression and you can pass it on.
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28101 Visits: 13268
Compression leads indeed to more CPU utilization, but if the CPU isn't under pressure, this shouldn't be a problem. Because the data is compressed, you need to use less IO resources, hence a possible faster query.

This isn't a magic button. It's not because you enable compression (and save a lot of disk space for large tables) that your query runs automatically faster. You'll need to test it out.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
RandomEvent
RandomEvent
Say Hey Kid
Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)Say Hey Kid (688 reputation)

Group: General Forum Members
Points: 688 Visits: 417
Think I agree with both Koen and HanShi on this one, optimising the table is fine, however it is also worth looking at the code accessing it, removal of non performant code like cursors etc. Maybe indexed views rather than direct table access checking if any serious locking is taking place if its a large heavily used table.

Optimisation is something that impacts more than just the underlying tables so a more global view often needs to be taken.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)

Group: General Forum Members
Points: 90273 Visits: 45284
Tables don't have performance. Queries have performance. Asking how to improve the performance of a table is meaningless, what you need to do is improve the performance of queries that run against the table.

Table size is not necessarily related to query performance. Large tables can have queries that perform well. Small tables can have queries that perform terribly. What you need to do is identify queries that need tuning and tune them.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


GilaMonster
GilaMonster
SSC Guru
SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)SSC Guru (90K reputation)

Group: General Forum Members
Points: 90273 Visits: 45284
Koen Verbeeck (8/29/2013)
HanShi (8/29/2013)
You are not to be improving a table, but you need to improve the queries accessing that table.


And how can you improve a query? By updating statistics, minimize logging, creating indexes, compress the data, partition the table, ... :-) ;-)


Maybe, no, maybe, maybe, no.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search