Forum Moderators: open
1. Loop through all 1,000 IDs and run a SELECT query for each
2. Build one massive query and put all 1,000 photo IDs in the SELECT query's IN clause
I know in general it's better to run less queries, but i'm just not sure if the IN clause is meant to contain so many values (and perform reliably).
Thanks in advance,
Brian
#1 would suit a more async Ajax situation in which the data is displayed as results from the DB are returned over time...
Anyone have any other ideas? I hope the photos are not being stored in the DB too... that would be a loong wait. Better to store a filesystem reference I think.
user A.. hits this function and uses the 1000 ids
user b hits this function, are they using the same ids?
Even if the 1000 becomes a different 1000 on another day is it the same 1000 or so that each user will be checking against?