Gordan Bobic <gordan@bobich.net> writes:
> After just having split the action into two parts (FTI delete + Master
> delete), it would appear that most of the delay does come from the triggers
> executing.
I imagine that the problem is that the triggers have to delete the FTI
records retail --- one master record's worth at a time. That's
inherently far less efficient than getting rid of all of them in a
single query, as your comparison case is doing. I see no easy way
to get around that in the context of the existing FTI design.
There is a new "tsearch" contrib module in 7.2 that might be worth your
time to look at instead. I'm not sure whether it's any better on this
measure, but at least it's a fresh implementation...
regards, tom lane