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

XMLWordPrintable

    • Team D
    • Sprint 33, Sprint 34, Sprint 35, Sprint 36, Sprint 37
    • 1

      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.

            gcalenko Gregory Chalenko
            grin Peter Gervai
            Team D
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: