-
Incident report
-
Resolution: Fixed
-
Major
-
1.8.2
-
None
-
1.8.2, PostgreSQL 8.3, 3M of records in table 'events'.
The following SQL statement takes 30 seconds:
SELECT DISTINCT e.* FROM events e WHERE ((e.eventid BETWEEN 000000000000000 AND 099999999999999)) ORDER BY e.eventid ASC LIMIT 1 OFFSET 0;
Without DISTINCT it needs 0.1 second or less.
We should not use DISTINCT if data is selected from one table. Front-end code should be reviewed.