Top "Filesort" questions

When MySQL needs to sort its output rows, and cannot do this via indexes, it uses a quicksort function called filesort(). This does not necessarily mean it will touch the disk at any time.

Using index, using temporary, using filesort - how to fix this?

I'm working on a event tracking system which uses a handful of lookup tables as well as the primary logging …

mysql optimization select temporary filesort
MYSQL performance slow using filesort

I have a simple mysql query, but when I have a lot of records (currently 103,0000), the performance is really slow …

mysql performance database-performance filesort
Why does MySQL Innodb "Creating sort index" when unique index exists?

On a simple but very large Innodb table, I have a unique index on column A and I want to …

mysql sql-order-by innodb filesort
MySQL Explain: what's causing 'Using temporary; Using filesort'

I'm planning on creating a view using this SQL SELECT, but the explain for it shows it's using temporary and …

mysql explain filesort
Optimizing MySql query to avoid using "Using filesort"

I need your help to optimize the query to avoid using "Using filesort".The job of the query is to …

mysql performance optimization query-optimization filesort
Mysql slow query: INNER JOIN + ORDER BY causes filesort

I'm trying to optimize this query: SELECT `posts`.* FROM `posts` INNER JOIN `posts_tags` ON `posts`.id = `posts_tags`.post_…

mysql optimization join sql-order-by filesort
MySQL: Avoid filesort when using IN and ORDER BY

Let's suppose I have the following table (let's call it my_table): CREATE TABLE `my_table` ( `table_id` int(10) unsigned …

sql mysql performance filesort