Project

General

Profile

Actions

Bug #81778

closed

Performance blocker calling @->getSchemaManager()->listTableColumns($tableName)@

Added by Stephan Großberndt over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Performance
Target version:
-
Start date:
2017-07-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I found a massive performance blocker in extbase due to the migration to doctrine: \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbBackend->clearPageCache() (which will be called for each inserted/updated/deleted Domain/Model object) does this to determine if the table has a pid column:

        $columns = GeneralUtility::makeInstance(ConnectionPool::class)
            ->getConnectionForTable($tableName)
            ->getSchemaManager()
            ->listTableColumns($tableName);
        if (array_key_exists('pid', $columns)) {

Calling ->getSchemaManager()->listTableColumns($tableName) is very costly, not only the column names but the whole information about the table including types and the like is fetched.

There are several places in the core where this is used to only iterate the available columns.

I propose to add at least a runtime cache so this information is not fetched during runtime for the same table over and over again.

Actions

Also available in: Atom PDF