-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
7.0.7
-
None
-
Ubuntu 22.04.5 LTS, zabbix-server 7.0.6, nginx 1.18.0, postgresql 14.13, timescaledb 2.17.2
Steps to reproduce:
- Execute sql query before problem time "EXPLAIN ANALYZE SELECT MAX(h.clock) FROM history_uint h WHERE h.itemid='10120751' AND h.clock>1737612045;"
- Check execution time and kind of index
- Execute sql query at problematic time "EXPLAIN ANALYZE SELECT MAX(h.clock) FROM history_uint h WHERE h.itemid='10120751' AND h.clock>1737612045;"
- Check execution time and kind of index
Result:
Before problem time :
-Execution time <1ms
-Index "_hyper_7_511_chunk_history_uint_1" btree (itemid, clock)
At problematic time :
-Execution time >5000ms
-Index "_hyper_7_511_chunk_history_uint_new_clock_idx" btree (clock DESC)
Can you tell me why the SQL query behaves this way? And for what purposes is this index (*_chunk_history_uint_new_clock_idx" btree (clock DESC)) used in table 'history_uint'?