Used query for history suboptimal and slow (up to 30 sec per item)

XMLWordPrintable

      It appears that the used query:

      select clock,ns,value from history_uint where itemid=786846 and clock<=1406552958 order by clock desc,ns desc limit 2;

      This works in many times faster:

      select clock,ns,value from history_uint where itemid=786846 and clock<=1406552958 order by clock desc limit 2;

      Please look the screenshots for details.

        1. explain.png
          explain.png
          42 kB
        2. time.png
          time.png
          77 kB

            Assignee:
            Unassigned
            Reporter:
            Oleg Ivanivskyi
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: