Re: myisamchk sorting records descending
Posted by:
JJWR
Date: May 19, 2005 01:03AM
Ulf what I want to do is to sort the rows physically descending in the disk. This is to avoid the 'order by filed DESC' en the querys and to take profit of the LIMIT clause.
Let's suppose that you select 60.000 rows with a full text search query but you only want the first 25 rows (concerning a key and descending) the you will do select * from table where match(textfield) against(...) order by sortfield DESC LIMIT 25
Select 60.000 rows with full text search costs a lot, order 60.000 rows costs a lot... and you only want the first 25 rows.
If you have the records already sorted in the disk (descending) you could do select * from table where match(textfield) against(...) LIMIT 25
This is incredible much faster because full text search engine only have to select the first 25 rows it founds and, also, mysql does no t have to perform a 60.000 rows sorting.
MyIsam does not support clustered indexes, so I must done periodically an offline physical sorting with
myisamchk --sort-index --sort-records=#key_num
The problem is that I need the physical sorting in descending order and myisamchk does not permit this :(
Subject
Views
Written By
Posted
7031
April 12, 2005 01:19AM
3252
April 25, 2005 02:44AM
3286
April 26, 2005 12:50AM
3077
April 27, 2005 01:12AM
4514
May 18, 2005 02:19AM
Re: myisamchk sorting records descending
4409
May 19, 2005 01:03AM
2969
May 19, 2005 02:22AM
2997
April 28, 2005 08:21AM
2887
May 04, 2005 05:24PM
3556
May 09, 2005 10:25AM
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.