```
SELECT t.compname, min(t2.version) FROM archdetails t
INNER JOIN svn3 b ON t.compname = b.compname
INNER JOIN archdetails t2 ON t.compname = t2.compname
WHERE ((b.revno = '270294' OR b.revno = 'r275869' OR b.revno = 'r393316'))
  AND t.version = '1.6'
GROUP BY t.compname`

```

Table `archdetails`:

```
Field                    | Type         | Null | Key | Default | Extra  
-------------------------+--------------+------+-----+---------+-------  
name                     | varchar(15)  | NO   |     | NULL    |  
compname                 | varchar(500) | NO   | MUL | NULL    |  
sno                      | int(11)      | NO   |     | NULL    |  
count                    | int(11)      | NO   |     | NULL    |  
fdindex                  | int(11)      | NO   |     | NULL    |  
version                  | varchar(10)  | NO   |     | NULL    |  
sdate                    | date         | NO   |     | NULL    |  
edate                    | date         | NO   |     | NULL    |  
inFlat                   | int(11)      | NO   |     | NULL    |  
inStar                   | int(11)      | NO   |     | NULL    |  
inNostar                 | int(11)      | NO   |     | NULL    |  
inReducedStar            | int(11)      | NO   |     | NULL    |

```

Table `svn3`:

```
Field    | Type          | Null | Key | Default | Extra  
---------+---------------+------+-----+---------+------  
name     | varchar(20)   | NO   | MUL | NULL    |  
revno    | varchar(10)   | NO   | MUL | NULL    |  
comp     | varchar(1000) | NO   | MUL | NULL    |  
compname | varchar(1000) | NO   |     | NA      |  

```

I have `1` index on `compname version` in `archdetails` and `4` indexes on `svn3` on `revno`; `revno, comp, compname`; `comp, compname`; and `name, revno, comp, compname`.

The indexes on compname is of length 100.

The query still takes `0.16 sec` to execute which is very expensive for my purpose. I don't have much experience with indexes and the above indexes have been created with variables most often used. Please advise on how to go about indexes.