Project

General

Profile

Actions

Bug #22959

closed

t3lib_db->listQuery() performance

Added by Caspar Stuebs almost 14 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2010-06-22
Due date:
% Done:

0%

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

Description

The function listQuery() uses a a like-construct to find a value in a comma-seperated list.
Mysql has a internal function for this called 'find_in_set'
This is 2.5 times faster.

Enclosed the performance check script and the patch.

(issue imported from #M14818)


Files

t3lib_db_listQuery_performance.patch (676 Bytes) t3lib_db_listQuery_performance.patch Administrator Admin, 2010-06-22 13:27
list_query_performance_check.tgz (1.5 KB) list_query_performance_check.tgz Administrator Admin, 2010-06-22 13:28
ux_t3lib_db_add_listQuery.patch (1.38 KB) ux_t3lib_db_add_listQuery.patch Administrator Admin, 2010-06-22 14:45
bug_14818_2.patch (2.92 KB) bug_14818_2.patch Administrator Admin, 2010-07-04 11:05

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #23087: FIND_IN_SET should be used instead of complicated LIKE where clauseClosedXavier Perseguers2010-07-03

Actions
Related to TYPO3 Core - Bug #23253: intExplode somehow returns comma-containing string valuesClosedErnesto Baschny2010-07-23

Actions
Actions #1

Updated by Georg Ringer almost 14 years ago

problem is, that this only works in mysql

Actions #2

Updated by Caspar Stuebs almost 14 years ago

That's right. But for any other db you have to use dbal ...

Actions #3

Updated by Xavier Perseguers almost 14 years ago

First of all, thanks Georg for having set the link with the feature request I just created in DBAL bugtracker.

Patch there for core adds support for FIND_IN_SET in t3lib_sqlparser.

I like the patch Caspar provided but I guess it's not needed at all as it involves using listQuery() each time we need to query such fields. Instead, I prefer simply use FIND_IN_SET in all queries and rewrite it completely in DBAL when needed, this way there's not yet another special API in t3lib_db ;-)

As there's at least one place in Core where the LIKE statement is hardcoded to query usergroups, I'll come with a patch to use FIND_IN_SET instead for this bug so don't close it in any way.

Actions #4

Updated by Xavier Perseguers almost 14 years ago

Actually I was too quick... your patch makes sense as it is already official. I'm adding support for FIND_IN_SET anyway but your patch for Core looks great. We should simply keep the t3lib_db_listQuery_performance.patch patch and not apply the one for DBAL and all should work well I guess.

Actions #5

Updated by Caspar Stuebs almost 14 years ago

but why do you won't add the path for the dbal?
if anyone uses the listQuery function in an extension and is using another db then mysql, the function has to be in dbal with the like statement to be sure that the function will work ...

Actions #6

Updated by Caspar Stuebs almost 14 years ago

I have created a new patch with changed function and an InvalidArgumentException.

Actions #7

Updated by Xavier Perseguers almost 14 years ago

Committed to:

- Core trunk (rev. 8197)
- DBAL trunk (rev. 35747)

Actions #8

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF