[TYPO3-core] Moving of elements (records) and pages in workspace

Martin Kutschker martin.kutschker-n0spam at no5pam-blackbox.net
Sat May 12 16:56:38 CEST 2007


Kasper Skårhøj schrieb:
> BTW:
> When I worked in Paris in March I tried to optimize their site. I found 
> that SQL statements in the backend selecting records in a workspace are 
> scanning the whole table! The reason is that they look up records like 
> this: "where (t3ver_oid=X OR uid=X)" Because it is an OR operation the 
> index table is NOT used at all and it cannot be used according to MySQLs 
> own explanation of how indexes work. It should say that both t3ver_oid 
> and uid is in the same index together. But even thought you could 
> imagine this to work, MySQL doesn't use it - hence it scans the whole 
> table in the Web>List module! I don't know yet how to solve this issue. 
> It is only found in the backend I believe.

Any or would mean that the DB had to use mor then one index (for one 
table) for the query which is not possible.

You could try and use a derive table like this

SELECT ... FROM
  (SELECT ... FROM table WHERE t3ver_oid=X
    UNION DISTINCT
   SELECT ... FROM table WHERE uid=X)
WHERE ...

Or you could simply duplicate the original statement

SELECT ... FROM table WHERE t3ver_oid=X AND ...
  UNION DISTINCT
SELECT ... FROM table WHERE uid=X AND ...

The ... have to be exactly the same.

Masi


More information about the TYPO3-team-core mailing list