I have spent 4 hours googling and trying all sorts of indexes, mysqlyog, reading, searching etc. When I add the GROUP BY the query changes from 0.002 seconds to 0.093 seconds. Is this normal and acceptable? Or can I alter the indexes and/or the query?

Table:

```
uniqueid    int(11) NO  PRI NULL    auto_increment  
ip  varchar(64) YES     NULL        
lang    varchar(16) YES MUL NULL        
timestamp   int(11) YES MUL NULL        
correct decimal(12,2)   YES     NULL        
user    varchar(32) YES     NULL        
timestart   int(11) YES     NULL        
timeend int(11) YES     NULL        
speaker varchar(64) YES     NULL        
postedAnswer    int(32) YES     NULL        
correctAnswerINT    int(32) YES     NULL

```

Query:

```
SELECT
  SQL_NO_CACHE 
  user,
  lang,
  COUNT(*) AS total,
  SUM(correct) AS correct,
  ROUND(SUM(correct) / COUNT(*) * 100) AS score,
  TIMESTAMP
FROM
  maths_score
WHERE TIMESTAMP > 1
  AND lang = 'es'
GROUP BY USER
ORDER BY (
    (SUM(correct) / COUNT(*) * 100) + SUM(correct)
  ) DESC
LIMIT 500

```

explain extended:

```
    id  select_type  table        type    possible_keys              key             key_len  ref       rows  filtered  Extra                                                                
------  -----------  -----------  ------  -------------------------  --------------  -------  ------  ------  --------  ---------------------------------------------------------------------
     1  SIMPLE       maths_score  ref     scoretable,fulltablething  fulltablething  51       const    10631    100.00  Using index condition; Using where; Using temporary; Using filesort  

```

Current indexes (I have tried many)

```
Keyname Type    Unique  Packed  Column  Cardinality Collation   Null    Comment

uniqueid    BTREE   Yes No  uniqueid    21262   A   No  

scoretable  BTREE   No  No  timestamp   21262   A   Yes 
    lang    21262   A   Yes

fulltablething  BTREE   No  No  lang    56  A   Yes 
    timestamp   21262   A   Yes
    user    21262   A   Yes

```