Performance Issue during Indexing - extra unused query
Posted May 13th, 2008 by douggreen
in
Not LIVE FROM THE MINNESOTA SEARCH SPRINT, but found on the plane ride home...
In search_index (the function that scores HTML), a SQL to UPDATE the {search_index} is done, and if that fails then an INSERT is done. However, since search_wipe is called just before this loop, there will never be any matching items for the UPDATE and it will always fail. The loop also can't introduce any duplicate records because the array key is the word. Thus I don't think we ever need to do the UPDATE. And the attached patch will half the number of queries needed for every word inserted into the index!