Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Excessive number of queries for metadata by PDO #212
When analysing queries from the DB side (PostgreSQL) we have discovered that the PDO is making a excessive number of queries for
The excessiveness is that we have around 500 queries on page and this generates around 1500 additional queries (depends on number of columns and custom types), which are quite fast, but still takes around 5% of whole request.
Could the method
@dg yes, only OID changes and in high numbers they are event duplicate... See pgsql_stmt_get_column_meta in https://www.askapache.com/pub/php/ext/pdo_pgsql/pgsql_statement.c
This solves our issue only partially (for the exact duplicate queries) thanks for that! ... Though I am not able to came up with any better solution as the the queries with different param values cannot be cached... The same for different queries referencing same table columns (i.e. both referencing
So this is probably all what can be done if the library doesn't want to obtain all this metadata bypassing the PDO (and with using caching)... which is probably overkill and will probably not gain anything speaking of performance.