Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-12104

Slow query in items.inc.php/item_get_history

    Details

    • Team:
      Team D
    • Sprint:
      Sprint 33, Sprint 34, Sprint 35, Sprint 36, Sprint 37
    • Story Points:
      1

      Description

      Postgresql partitioned db is slow as hell on a hot summer day. Seems these queries take forever plus one day:

      SELECT MAX(clock) AS clock FROM history WHERE itemid='135968' AND clock <= 1482098389;

      No matter how to index, this will seq scan all the indexes, and all the partitioned tables in the past (since clock will not limit the search without the lower bound, and the table is partitioned based on clock).

      Limiting the lookback (arbitrarily picked 3days, one day would be as good) makes it great again. See attachment.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gcalenko Gregory Chalenko
                Reporter:
                grin Peter Gervai
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: