-
-
Notifications
You must be signed in to change notification settings - Fork 110
Description
Version: 2.4.6
When analysing queries from the DB side (PostgreSQL) we have discovered that the PDO is making a excessive number of queries for pgclass and pgtype... We investigated that these queries origin from PDO extension itself (hence not visible in any query monitoring done on PHP runtime) and are caused by nette/database from Helpers::detectTypes() where PDO::getColumnMeta() is called.
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 detectTypes() be efficient? Maybe caching? (However that may not be a good idea as schema can change during execution.)