Change record status: 
Project: 
Introduced in branch: 
11.5.x
Introduced in version: 
11.5.0
Description: 

The PostgreSQL driver needs the blob and serial columns of a table to run insert, update and upsert queries. Before, Schema::queryTableInformation() collected this information with one catalog query per table, on every request.

Now a TableInformationLoader collects the information for all tables of a connection with one catalog query. The result is cached in the bootstrap cache bin. Schema changes delete the cached information. The new pgsql.table_information_prewarmer service prewarms the cache of the default connection.

Each connection owns one loader. Driver code gets it through a new public method:

$info = $connection->tableInformation()->getTableInformation($table);

Schema::queryTableInformation() still exists and returns the same result:

$info = $connection->schema()->queryTableInformation($table);

Code that alters PostgreSQL tables without the schema API must clear the cached information, for example with a schema change through the schema API or a cache clear.

Impacts: 
Site builders, administrators, editors
Module developers