Optimizing search with multiple linked rows

Thank you - this makes sense, letting the database to the hard work.

However, I am still seing query-times of upwards to 3-4 seconds,

Do you have any other suggestions?

I’m having a hard time debugging exactly what it is, that is making the queries slow. I suppose a redesign of the table-structure, combining Customer and Location (as they already have a 1-to-1 relationship), would be a way to speed things up.