1

Say I have an index on (a, b, c) and I perform CLUSTER on that index. How exactly will the data be stored? I would assume it's something like this (just guessing): first sort by a, then by b, then by c. For example:

(a, b, c)
---------
(1, 1, 1)
(1, 1, 2)
(1, 2, 5)
(2, 1, 4)
(3, 1, 1)

That means, if I want to have it ordered by b first, I can drop the index, re-create it as (b, a, c), then CLUSTER?

1 Answer 1

4

Yes, CLUSTER recreates the table in the order of the index.

To get (b,a,c) you could also create a new index, then cluster on that new index, then remove the index.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.