If you want to use relations, the first method is the way to go. I dont know how large the query becomes, but it doesnt have to be a problem. Use something like Clockwork to check the timings on the query. I have some pretty large queries like this in one of my projects, and it's very fast.
SELECT * FROM "attributes" WHERE "attributes"."container_id" in (... about 300 ids .. )
This took 3ms.
Thanks!!
But I'm still curious about if it is possible (in mysql) to build a very very long query (maybe with 1000 or more ids? ).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community