MySQL Forums
Forum List  »  Partitioning

Re: How to handle secondary keys in partitioning?
Posted by: Mattias Jonsson
Date: May 04, 2010 01:29PM

I'm not sure if I understand what you ask about, but I'll try to explain what I think you are looking for:

Partitioning handles indexes automatically, also secondary indexes, so you do not have to do queries for each partition separately. Partitioning also make use of indexes for lookups and sorting, just like non partitioned tables.

An ordered index read from a partitioned tables is implemented by the partitioning handler ha_partition by:

1) do an ordered index read from each partition that is not pruned away
2) use a priority queue (merge sort) to return the 'first' row
3) do an index next read from the partition which the returned row came from (i.e. keep the priority queue filled with one row per partition).

That way you (as a user) do not have to query each partition your self or sort the result without making use of the index.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.