I still have following problem

```
EXPLAIN EXTENDED SELECT
  `item`.`id`,
  `item`.`timestamp`,
  `item`.`label`
  FROM
  item
WHERE
  item.dataTypeId=30
GROUP BY
  item.id
ORDER BY
  item.timestamp DESC
LIMIT 0,6;

```

**Id & timestamp** is a primary key pair (mediumint+datetime)
**dataTypeId** is a foreign key (mediumint)
table is created as **InnoDb** 

There can be more records with same id and different timestamp (versions of same item). This is the **reason for group by**.

I read for example this one: [similar topic on stackoverflow](https://stackoverflow.com/questions/1471243/using-filesort-to-sort-by-datetime-column-in-mysql)

but it didnt solve my problem.

I've tried to create following indexes:

1. index on (dataTypeId, id, timestamp) - in that order
2. index on (dataTypeId, timestamp) - in that order
3. index on id
4. index on timestamp

the last two is a little piece of desperation

i think i must miss something basic -  

but really do no know what.  

Do not expect the solution (it would be nice :) just kick me the right way :)

sort\_buffer\_size is now 4194288

**edit:**
explain - no indexes

```
"1" "SIMPLE"    "item"  "ref"   "FK_dataTypeId" "FK_dataTypeId" "4" "const" "5608"  "Using where; Using temporary; Using filesort"

```

explain with indexes created

```
"1" "SIMPLE"    "item"  "ref"   "FK_udssDataItem_1,testIndexType,testIndexTypeTimestamp,testIndexTypeIdTime"    "FK_udssDataItem_1" "4" "const" "5632"  "Using where; Using temporary; Using filesort"

```