Bug #66231

Workspace very slow loading page tree

Added by TSniper no-lastname-given over 4 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2015-04-02
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello everybody,

I wish that i'm posting in the right place for this issue that i have, with my team we have just upgraded from 4.6 to 6.2 Since then editors have major performance issues in the typo3 backend.

They get a lot of timeouts when trying to open pages in the backend ("Connection Problem Sorry, but an error occurred while connecting to the server. Please check your network connection.")

It takes sometimes up to 5 minutes until the page tree is opened.

We saw the the request to typo3/ajax.php?ajaxID=ExtDirect::route&namespace=TYPO3.Components.

PageTree really takes a long long time, get´s timeouts or even responds with 500.
Basically the backend becomes impossible to work in.

i think the problem is realated to the TYPO3\CMS\Workspaces\ExtDirect\AbstractHandler.

File : AbstractHandler.php

92 : $versions = $this->getWorkspaceService()->selectVersionsInWorkspace($this->getCurrentWorkspace(), 0, -99, -1, 0, 'tables_select', $this->validateLanguageParameter($parameters));

Any body can help me on this ?

Thanks in advance.


Related issues

Related to TYPO3 Core - Bug #61184: Backend - Page Tree in Workspace & Publish content - Performance Issue - BackendUtility::countVersionsOfRecordsOnPage Closed 2014-08-26
Related to TYPO3 Core - Task #50349: Reduce SQL queries of page tree in workspaces Closed 2013-07-24
Related to TYPO3 Core - Task #69439: Enhance SQL query reduction in page tree in workspaces Closed 2015-08-31
Related to TYPO3 Core - Bug #77618: Workspace PageTree can become super-slow Closed 2016-08-24

Associated revisions

Revision 37cd2d50 (diff)
Added by Nicole Cordes about 4 years ago

[TASK] Reduce SQL queries of page tree in workspaces

Nodes of the page tree are highlighted, if that particular node
has versioned elements in the current workspace. However, this is
determined by iterating over all tables and all records for each
page. If having installed many extensions with many tables and
many records, this will produce a lot of SQL queries.

This patch introduces a new cache for record versions per page which is
fetched once from the database. This cache is located within the
\TYPO3\CMS\Workspaces\Service\WorkspaceService and can be shared between
several other classes as this is implements a SingletonInterface.

Resolves: #50349
Resolves: #66231
Related: #61184
Releases: master, 6.2
Change-Id: Ibaef07bdab87147c6826af8578870c52803dfe03
Reviewed-on: http://review.typo3.org/22528
Reviewed-by: Georg Ringer <>
Tested-by: Georg Ringer <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision d2c4bbbb (diff)
Added by Nicole Cordes about 4 years ago

[TASK] Reduce SQL queries of page tree in workspaces

Nodes of the page tree are highlighted, if that particular node
has versioned elements in the current workspace. However, this is
determined by iterating over all tables and all records for each
page. If having installed many extensions with many tables and
many records, this will produce a lot of SQL queries.

This patch introduces a new cache for record versions per page which is
fetched once from the database. This cache is located within the
\TYPO3\CMS\Workspaces\Service\WorkspaceService and can be shared between
several other classes as this is implements a SingletonInterface.

Resolves: #50349
Resolves: #66231
Related: #61184
Releases: master, 6.2
Change-Id: Ibaef07bdab87147c6826af8578870c52803dfe03
Reviewed-on: http://review.typo3.org/41425
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

Revision c45de676 (diff)
Added by Nicole Cordes about 4 years ago

[FOLLOWUP][TASK] Reduce SQL queries of page tree in workspaces

The patch adds a check if workspaces is activated before using its
class and function.

Releases: 6.2
Resolves: #50349
Resolves: #66231
Related: #61184
Change-Id: I12bc2d496f2216725ac97a8640bc6c431630cc7a
Reviewed-on: http://review.typo3.org/41553
Reviewed-by: Daniel Goerz <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>
Reviewed-by: Nicole Cordes <>
Tested-by: Nicole Cordes <>

History

#3 Updated by Martin Tepper over 4 years ago

We checked the commit from Oliver and got a better performance. The difference is around 5 seconds!

#4 Updated by Gerrit Code Review over 4 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/38700

#5 Updated by Grigori Prokhorov about 4 years ago

Hi all,

Martin Trepper's patch from comment #66231-2 does in fact resolve the issue.

The original code is apparently yet unchanged in any TYPO3 CMS 6 version up1 to2 6.2.12, so that I don't quite see how this could solve this issue aside from being a temporary fix.

The only issue I have with the patch is that it drops the second part of the workspace record check, i.e. the WHERE-clause includes

'A.pid=-1' .
' AND A.t3ver_wsid=' . $workspaceId .
' AND A.t3ver_oid=B.uid' .
BackendUtility::deleteClause($tableName, 'A') .
BackendUtility::deleteClause($tableName, 'B')

what for tt_content translates to
SELECT                                   
    B.uid as live_uid,                   
    B.pid as live_pid,                   
    A.uid as offline_uid                 
FROM                                     
    tt_content as A,                     
    tt_content as B
WHERE                                    
    A.pid = -1                           
    AND A.t3ver_wsid = ###WORKSPACE_ID###
    AND A.t3ver_oid = B.uid              
    AND A.deleted = 0                    
    AND B.deleted = 0                    

but drops the part
    A.t3ver_oid = B.uid
AND A.t3ver_state<>4
 OR A.t3ver_oid=B.t3ver_move_id
AND A.t3ver_state=4

This means that the versioning state is not regarded at all, although it's not quite clear to me why it should have been regarded in the first place since an editor can not select the versioning state when looking at the page tree anyway.

I am therefore "+1"-ing the solution proposed in #66231 to be included into the core as a proper fix for this issue.

Best,
Grigori


1 https://forge.typo3.org/projects/typo3cms-core/repository/revisions/master/entry/typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php#L930

2 https://forge.typo3.org/projects/typo3cms-core/repository/revisions/master/entry/typo3/sysext/workspaces/Classes/ExtDirect/PagetreeCollectionsProcessor.php#L75

#6 Updated by Gerrit Code Review about 4 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22528

#7 Updated by Gerrit Code Review about 4 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/22528

#8 Updated by Nicole Cordes about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#9 Updated by Gerrit Code Review about 4 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41425

#10 Updated by Gerrit Code Review about 4 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41425

#11 Updated by Nicole Cordes about 4 years ago

  • Status changed from Under Review to Resolved

#12 Updated by Gerrit Code Review about 4 years ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41553

#13 Updated by Nicole Cordes about 4 years ago

  • Status changed from Under Review to Resolved

#14 Updated by Sara no-lastname-given about 4 years ago

We've tried this fix but it just breaks the website.

Need to go live at the end of this week so if anyone has any ideas on fixing this problem I'd be very grateful!

A new ticket has been opened detailing the problems we're having https://forge.typo3.org/issues/69068

#15 Updated by Benni Mack 11 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF