Hi,
Thx for the tip and I'll note it for the development and will check to see if
it could be easily done. From a short thinking about it, it looks like the general
case can be a bit complex although not really hard, but possibly there are some
special case that is really simple.
I am not sure however why you ORDER BY on more than a,b since it was the
primary key and thus should be unique so there is only one record to sort on
c,d.
Rgrds Mikael
Steven Roussey wrote:
> Ah!!
>
> That looks great, but I have one important
> request. Currently we manually partition our
> tables, and one thing we do as part of our
> database management is to to an ALTER TABLE ...
> ORDER BY on each table (partition). In real life
> situations, this one thing has such an advantage
> in speed over the life of the tables that is
> mandatory. We never changed to InnoDB because of
> it, etc.
>
> BTW: We do the ORDER BY on a key that is not the
> PK but does have the PK columns as the first
> columns in its key. (PK is (a,b), the key we order
> by is (a,b,c,d)).
>
> Can we add:
>
> ALTER TABLE t1 PARTITION (x0) ORDER BY (a,b,c,d);
>
>
> ???
>
> Thanks!
Mikael Ronstrom
Senior Software Architect, MySQL AB
My blog:
http://mikaelronstrom.blogspot.com