[TYPO3-core] RFC #11979: TCEforms suggest doesn't find everything on large sites and is slow

JoH asenau info at cybercraft.de
Thu Sep 17 17:30:45 CEST 2009


>> I think, then all possible pids (pidList + children) are added to
>> the SQL query, aren't they?
>
> Yes, but that's not possible any other way because of the structure
> how items are stored in TYPO3 or more general in most relational
> database models. If we had e.g. nested tree sets implemented, getting
> items would be a lot easier - but this would pose other problems when
> updating these large data sets.
>
>> Admins of districts would have about 5000 pages in the resulting
>> query
>
> That of course is too much - I don't know how MySQL handles these
> large WHERE clauses or IN statements, but I doubt that they will be
> handled in a way you could seriously call efficient...
>
> Any MySQL experts to the rescue? ;)

This is not a MySQL approach but maybe it can help anyway:

Usually you are looking for recrods of just one table.
In some cases there might be an MM_table to be considered.

What if the search is done the other way around?
Instead of fetching all the pages and then checking, if they contain any of
the desired records _and_ the user has access to them, maybe the query
should use the table of the records and check for existing pid values.

In this case the results could be counted and grouped by pid within just one
query and the result would be
a) a reduced "page tree", since only pages containing at least one of the
desired records would be in there
b) an exact number of possible records to decide about limits and other
stuff

After that it should be much easier to make an intersection of accessible
pages and pages that are containing at least one record, because you don't
have to put the whole page tree into the IN statement.

The result of this check could be cached so that the query won't be executed
for each "keydown" but only for the first one, which should not give results
anyway, because people are used to a search executed with the second
"keydown".

Just some thoughts ... but maybe I am completely wrong ;-)

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your gob sometimes!)
Dieter Nuhr, German comedian
Xing: http://contact.cybercraft.de
Twitter: http://twitter.com/bunnyfield
TYPO3 cookbook (2nd edition): http://www.typo3experts.com
TYPO3 workshops: http://workshops.eqony.com




More information about the TYPO3-team-core mailing list