As a followup to #2155767: Improve the speed of full text searches by using a single index table, I made a last-minute change to the index as we were deploying on Drupal.org. The subquery often checks both word and field_name, so I thought a covering index would be ideal.

CommentFileSizeAuthor
#5 2170689.diff2.8 KBdrumm
#1 2170689.diff1.03 KBdrumm

Comments

drumm’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

Here is the patch.

drunken monkey’s picture

Hm, normally we shouldn't change an existing update hook, but instead provide a new one. Otherwise, people who have already updated won't ever get this change executed. However, in this case I guess it doesn't matter that much, since things will work just the same either way, only maybe a bit slower without the update. And people could just change the index manually if they still want the improvement.
Is this your opinion, too, Neil? Or did you just post the patch as an illustration, but intended a proper patch to be written and committed?
In any case, thanks for pointing out another possibility for a performance improvement!

Any other opinions on this?

drumm’s picture

I'm okay with either way. Since it has been a few weeks since the original commit, it may be better to do a separate update function.

If we do an additional update, we should still roll the change into the exiting update, and make changes the second one only if the indexes aren't set correctly. This will cut down on overall update time.

drunken monkey’s picture

Status: Needs review » Needs work

If we do an additional update, we should still roll the change into the exiting update, and make changes the second one only if the indexes aren't set correctly. This will cut down on overall update time.

OK, makes sense, let's do it that way! Do you know how to check for that, though? I can't seem to find a function that would allow reading the current index definition.

drumm’s picture

Status: Needs work » Needs review
StatusFileSize
new2.8 KB

Yep, looks like there isn't a way to get the current index definition. This patch uses the index name to check.

drunken monkey’s picture

Status: Needs review » Fixed

Looks great, thanks!
Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.