Some SQL statements are quite slow

XMLWordPrintable

    • Type: Incident report
    • Resolution: Fixed
    • Priority: Major
    • 1.8.3
    • Affects Version/s: 1.8.2
    • Component/s: Frontend (F)
    • None
    • Environment:
      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.

            Assignee:
            Unassigned
            Reporter:
            Alexei Vladishev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: