-
Incident report
-
Resolution: Unresolved
-
Trivial
-
None
-
2.4.7rc1
-
Oracle DB
In frontend I found not optimal sql query for Oracle.
SELECT * FROM (SELECT FROM history_uint h WHERE h.itemid='373778' ORDER BY h.clock DESC) WHERE rownum BETWEEN 0 AND 1
This is too slow.(~300sec on my db)
I applied the workaround.
SELECT * FROM history_uint h WHERE h.itemid='373778' and h.clock = (SELECT max(h2.clock) FROM history_uint h2 WHERE h2.itemid='373778')
This query executed about 0.5-2 sec.