7

I understand how it works, but the book I'm studying doesn't tell me why you'd want to partition. Could someone shed some light? I can't understand any concept unless I see how it's useful.

Leigh Riffel
23.9k17 gold badges80 silver badges155 bronze badges
asked Jun 29, 2010 at 8:59

1 Answer 1

10

Basically, to split up a huge table into smaller sub tables or partitions

  • offload data into different files/filegroups (with changes in backup/restore strategy too)
  • separate "working" from "historic" data (without having 2+ separate tables which complicates queries)
  • allow compression of older data

We're talking 100s of millions of rows and/or high volumes.

You don't partition for a few million rows.

answered Jun 29, 2010 at 9:04
3
  • That, and the advantages of partition pruning (don't look in partitions if you know the data ain't there) and parallel execution (you can access multiple partitions at the same time to do a SUM or COUNT or other aggregate) Commented Jun 29, 2010 at 9:07
  • 1
    Does it speed up SQL if you split it to multiple files? Isn't there a better archive strategy than just splitting it up? I'd have thought you would physically move the old data to a new table, or back it up / compress it to another computer somewhere, not just leave it in the same folder. Commented Jun 29, 2010 at 9:07
  • 2
    It'll also affect your indexes, so if you have a few years worth of archive data in one partition and only the present year in another, searching through the present year's partition involves only that partition's indexes. Commented Jan 26, 2012 at 14:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.