jethro-pmm icon indicating copy to clipboard operation
jethro-pmm copied to clipboard

Slow query on feed_uuid

Open tbar0970 opened this issue 2 years ago • 2 comments

# **Query_time: 4.844153**  Lock_time: 1.649781 Rows_sent: 1  Rows_examined: 1302
SELECT person.id, person.first_name, person.last_name, person.gender, person.age_bracketid, person.familyid, person.congregationid, person.status, person.email, person.mobile_tel, person.work_tel, person.remarks, person.status_last_changed, person.created, person.creator, person.feed_uuid, f.family_name, f.address_street, f.address_suburb, f.address_state, f.address_postcode, f.home_tel, c.name as congregation, ab.label as age_bracket
				FROM ((person)
						JOIN family f ON person.familyid = f.id)
						LEFT JOIN congregation c ON person.congregationid = c.id
						JOIN age_bracket ab on ab.id = person.age_bracketid 
					WHERE (LOWER(person.feed_uuid) = '0zyrh8esuyirrvjzl4zzbhwcvcndvjnouqoe4t5a18fdxn9wd2iiywc4kmla');

Do we need to add an index on feed_uuid ?

tbar0970 avatar Jan 25 '23 04:01 tbar0970

Again, 0.008s on MariaDB.

jefft avatar Jan 25 '23 05:01 jefft

Fair enough, although that'd be a on server without any load.

I'm keen to have a quick look at these slow queries anyway to see if there are any obvious and unnecessary inefficiences to fix.

tbar0970 avatar Jan 25 '23 05:01 tbar0970