[ZBX-23012] Slow query from LLD worker Created: 2023 Jun 22 Updated: 2024 Apr 10 Resolved: 2023 Oct 22 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Proxy (P), Server (S) |
Affects Version/s: | 6.0.19rc1, 6.4.4rc1 |
Fix Version/s: | 6.0.23rc1, 6.4.8rc1, 7.0.0alpha7, 7.0 (plan) |
Type: | Problem report | Priority: | Critical |
Reporter: | Edgar Akhmetshin | Assignee: | Konstantins Prutkovs (Inactive) |
Resolution: | Fixed | Votes: | 2 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
RHEl8
|
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
||||||||||||||||
Issue Links: |
|
||||||||||||||||
Team: | |||||||||||||||||
Sprint: | Sprint 104 (Sep 2023), Sprint 105 (Oct 2023) | ||||||||||||||||
Story Points: | 1 |
Description |
Steps to reproduce: item_discovery | 26 GB | 28250169344 item_tag | 11 GB | 11745476608 Result: 3691797:20230622:152622.129 query [txnlev:0] [select ip.item_parameterid,ip.itemid,ip.name,ip.value from item_discovery id join item_parameter ip on id.itemid=ip.itemid where id.parent_itemid in (9541102,9541103,9541104)] 3691797:20230622:152622.130 query [txnlev:0] [select it.itemtagid,it.itemid,it.tag,it.value from item_discovery id join item_tag it on id.itemid=it.itemid where id.parent_itemid in (9541102,9541103,9541104)] 3691797:20230622:152628.856 slow query: 6.726439 sec, "select it.itemtagid,it.itemid,it.tag,it.value from item_discovery id join item_tag it on id.itemid=it.itemid where id.parent_itemid in (9541102,9541103,9541104)" 3691797:20230622:152628.857 End of lld_items_get() 3691797:20230622:152628.857 In lld_items_make() Expected: |
Comments |
Comment by Edgar Akhmetshin [ 2023 Sep 01 ] |
zabbix-server-pgsql-6.4.6-0.ZBX23012.el8.x86_64.rpm Or workaround for PgSQL based instances: alter system set enable_seqscan=OFF; select pg_reload_conf(); |
Comment by Steve [ 2023 Sep 04 ] |
Hi Edgar, Did this make it into 6.4.6? I don't see it in the release notes Release Notes for Zabbix 6.4.6 |
Comment by Edgar Akhmetshin [ 2023 Sep 20 ] |
Users can see the status of ZBX and Fix version is empty with status 'Need info'. Currently the solution is tested internally, and if you have feedback regarding the shared package with a patch - provide it, if you need Docker images ( git clone https://github.com/zabbix/zabbix-docker.git cd zabbix-docker git checkout 6.0 docker-compose -f docker-compose_v3_alpine_pgsql_local.yaml build --build-arg ZBX_VERSION="feature/ZBX-23012-6.4" --parallel docker-compose -f docker-compose_v3_alpine_pgsql_local.yaml up -d If rebuilding is not a option for you - we can offer paid services to prepare patched containers in priority for you. |
Comment by Vladislavs Sokurenko [ 2023 Sep 28 ] |
Looks like the reason is that index does not favour low level discovery:
"item_discovery_1" UNIQUE, btree (itemid, parent_itemid)
But condition is to select itemids where parent_itemid=<id> CREATE UNIQUE INDEX item_discovery_3 ON item_discovery (parent_itemid,itemid); CREATE INDEX item_discovery_4 ON item_discovery (itemid); drop index item_discovery_1; drop index item_discovery_2; |
Comment by Konstantins Prutkovs (Inactive) [ 2023 Oct 18 ] |
Available in versions:
|