Answer the question
In order to leave comments, you need to log in
How bad is it to use such a request?
I'm making a kind of online store on Laravel. And Eloquent offers this query option:
select * from `products` where exists (
select `id` from `properties_values_int`
where `products`.`id` = `properties_values_int`.`product_id` and `value` = ?
) and exists (
select `id` from `properties_values_string`
where `products`.`id` = `properties_values_string`.`product_id` and `value` = ?
) and exists (
select `id` from `properties_values_string`
where `products`.`id` = `properties_values_string`.`product_id` and `value` = ?
)
Answer the question
In order to leave comments, you need to log in
The answer is irrelevant without load data.
If there is no load, then this is quite a good request.
If this query is executed for a long time, but there are frequent calls to it, that data does not change there, then it makes sense to prepare a selection in advance, write the result to a separate table and give this data to users
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question