Query causing huge load on mysql
Hi,
I've noticed that occassionally a single query - always the same - causes a huge load ony the system, including iowait. It's always the same, the queries are taking more than one hour to run. I've posted the output of
show full processlist\G
below, the culprit - this time - is:
select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Any idea what the problem is? Is there an index missing or why are the queries running for mor than an hour?
Here's the output of mariadb's processlist:
*************************** 2. row ***************************
Id: 310
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 3585
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 3. row ***************************
Id: 545
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 3486
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 4. row ***************************
Id: 1367
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 3284
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 5. row ***************************
Id: 1662
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 3217
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 6. row ***************************
Id: 2214
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2983
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 7. row ***************************
Id: 2343
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2914
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 8. row ***************************
Id: 2755
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2681
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 9. row ***************************
Id: 3089
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2597
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 10. row ***************************
Id: 3870
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2372
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 11. row ***************************
Id: 4150
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2162
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 12. row ***************************
Id: 4786
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 2066
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 13. row ***************************
Id: 4984
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1967
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 14. row ***************************
Id: 5213
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1885
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 15. row ***************************
Id: 5371
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1740
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 16. row ***************************
Id: 5531
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1659
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 17. row ***************************
Id: 6037
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1431
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 18. row ***************************
Id: 6116
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1329
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 19. row ***************************
Id: 6448
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1129
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 20. row ***************************
Id: 6717
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 1027
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 21. row ***************************
Id: 7220
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 820
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 22. row ***************************
Id: 7431
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 720
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 23. row ***************************
Id: 8097
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 473
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 24. row ***************************
Id: 8199
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 413
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 25. row ***************************
Id: 8922
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 124
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000
*************************** 26. row ***************************
Id: 8961
User: hubzilla_netzgemeinde
Host: localhost
db: hub_netzgemeinde_eu
Command: Query
Time: 99
State: Sending data
Info: select channel_hash as hash from channel left join item on channel.channel_id = item.uid where ( item.thr_parent = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' OR item.parent_mid = 'https://hub.netzgemeinde.eu/item/e84de8c4-aba5-44d2-a911-b1812b087685' )
Progress: 0.000