Subject | Looking for advice on indexes |
---|---|
Author | Marcin Bury |
Post date | 2013-05-03T10:21:56Z |
Hello All
I have following table named TSH:
ID INTEGER
SITE VARCHAR(50)
WORK_DATE DATE
each day there are 10 up to 15 records inserted with various sites.
The list of sites is quite limited and consists of around 50 items.
Then I have following query
SELECT SITE_ID, MAX(WORK_DATE)
FROM TSH
GROUP BY 1
to get the latest entry for each site
What indexes should I create to get this query as quickest as possible?
Currently I have around 5000 records in the table.
Thanks in advance
Marcin
I have following table named TSH:
ID INTEGER
SITE VARCHAR(50)
WORK_DATE DATE
each day there are 10 up to 15 records inserted with various sites.
The list of sites is quite limited and consists of around 50 items.
Then I have following query
SELECT SITE_ID, MAX(WORK_DATE)
FROM TSH
GROUP BY 1
to get the latest entry for each site
What indexes should I create to get this query as quickest as possible?
Currently I have around 5000 records in the table.
Thanks in advance
Marcin