Say I have a query that fetches [type][show_name].
For all [type]==5 records, I need to join them with another table.
What would be the best approach for that:
- Join for all records between the two tables (looks bad).
- Run the query and then run again on the result set, fetch all the IDs and do a IN query on the table I need to join with.
- Fetch the missing data only after what I have is presented (using the same IN query), maybe with an AJAX approach.
- Something I haven't thought of.
Important thing is, I want the user to see at least some of the data as fast as possible, but I also want the code to be straight forward, without too much spaghetti.