In the last episode (Dec 13), Jacek Becla said:
> Is there a way to find which index was used to sort
> MyISAM table (suppose someone run
> "myisamchk --sort-index --sort-records=2" in the past,
> how to find that sorting was done based on index #2?)

You can run a "select * from mytable" and see whether any columns are
in order; that's about it.  Note that if records were inserted/deleted
since the sort, no column may be completely in order.
 
> And a related question: how to determine which is
> the index "#2"? I guess if I look at the order of indexes
> in the 'SHOW CREATE TABLE <name>' report that will do it.
> Is that the right way? Is there more official way?

You can also use SHOW FIELDS from <name>, or 

select column_name from information_schema.columns 
 where table_name="<name>" and table_schema="<schema>" 
       and ordinal_position=2;

-- 
        Dan Nelson
        [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to