Suppose I have a table structure like
I want to grab all user metas
is it better to do a big query joining all tables in the image ...
SELECT [columns ...] FROM usermetasections LEFT JOIN usermetakeys ON ...
LEFT JOIN usermetas ON ...
LEFT JOIN users ON ...
WHERE users.id = xxx
...
... or break them into smaller queries like ...
Loop through SELECT * FROM usermetasections
Loop through SELECT * FROM usermetakeys WHERE section = xxx
Loop thought SELECT * FROM usermetas WHERE key = xxx AND user = xxx
I think if I go the 1st approach, it will be faster for "machine" performance but bad for developer performance? harder to read, more code to parse queries into PHP objects?