Improve select query in problem view in case of pager used

XMLWordPrintable

    • Type: Change Request
    • Resolution: Unresolved
    • Priority: Trivial
    • None
    • Affects Version/s: 4.2.8
    • Component/s: Frontend (F)
    • None

      Monitoring -> Problems.

      The story is what happens underneath the hood in case I click on "2" in the pager (paginator):

      Usually, it performs a full "download" based on the record count what is configured "Limit for search and filter results"

      Turns out in SQL level there is an option to filer events with just exactly the right amount of count as requested:

      page1 (first 10 records): select eventid from events limit 0,10;

      page2 (next 10 records) select eventid from events limit 10,10;

      page3 (records from 20 to 30): select eventid from events limit 20,10;

      MariaDB [zabbix]> select eventid from events limit 0,10;
      +---------+
      | eventid |
      +---------+
      |  150215 |
      |  150217 |
      |  150219 |
      |  150221 |
      |  150223 |
      |  150225 |
      |  150227 |
      |  150229 |
      |  150231 |
      |  150233 |
      +---------+
      10 rows in set (0.000 sec)MariaDB [zabbix]> select eventid from events limit 10,10;
      +---------+
      | eventid |
      +---------+
      |  150235 |
      |  585499 |
      |  585504 |
      |  754282 |
      |  754289 |
      |  754290 |
      |  754305 |
      |  754306 |
      |  754307 |
      |  754308 |
      +---------+
      10 rows in set (0.001 sec)MariaDB [zabbix]> select eventid from events limit 20,10;
      +---------+
      | eventid |
      +---------+
      |  754309 |
      |  754310 |
      |  754313 |
      |  754316 |
      |  754317 |
      |  754322 |
      |  754339 |
      |  754342 |
      |  754343 |
      |  754344 |
      +---------+
      

      Original situation:

      10 rows in set (0.001 sec)MariaDB [zabbix]> select eventid from events limit 30;
      +---------+
      | eventid |
      +---------+
      |  150215 |
      |  150217 |
      |  150219 |
      |  150221 |
      |  150223 |
      |  150225 |
      |  150227 |
      |  150229 |
      |  150231 |
      |  150233 |
      |  150235 |
      |  585499 |
      |  585504 |
      |  754282 |
      |  754289 |
      |  754290 |
      |  754305 |
      |  754306 |
      |  754307 |
      |  754308 |
      |  754309 |
      |  754310 |
      |  754313 |
      |  754316 |
      |  754317 |
      |  754322 |
      |  754339 |
      |  754342 |
      |  754343 |
      |  754344 |
      +---------+ 

       

            Assignee:
            Valdis Murzins
            Reporter:
            Aigars Kadikis
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated: