rossmohax
Joined 11 years ago
Karma
1,009
Submissions
405
Member since
Dec 17
Email: [email protected]
View on Hacker NewsJoined 11 years ago
- every query has to be planned
- your DB driver can't prepare query as they are all different
- collecting per query stats becomes nightmare if number of arguments per query varies in wide range. metrics cardinality is a problem.
Correct way to handle it is pass all args as single parameter of type array and use `= ANY($1)` or if there are multiple columns build a virtual table and join:
SELECT a,b FROM table
NATURAL JOIN ROWS FROM (
unnest($1::type_of_a[]),
unnest($2::type_of_b[])
) t(a,b)I am not worried about UI representation of the model like many comments, it is not the main point of this project as I understand. UI just that - a representation, same relationships might as well be coded in HCL or the like of it.