Re: tsearch parser inefficiency if text includes urls or emails - new version - Mailing list pgsql-hackers

From Andres Freund
Subject Re: tsearch parser inefficiency if text includes urls or emails - new version
Date
Msg-id 200911140139.45534.andres@anarazel.de
Whole thread Raw
In response to Re: tsearch parser inefficiency if text includes urls or emails - new version  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
On Saturday 14 November 2009 01:03:33 Kevin Grittner wrote:
> It is in context format, applies cleanly, and passes "make check".
Unfortunately the latter is not saying much - I had a bug there and it was not 
found by the regression tests. Perhaps I should take a stab and add at least 
some more...

> It is in context format, applies cleanly, and passes "make check".
> Next I read through the code, and have the same question that Andres
> posed 12 days ago.  His patch massively reduces the cost of the parser
> recursively calling itself for some cases, and it seems like the least
> invasive way to modify the parser to solve this performance problem;
> but it does beg the question of why a state machine like this should
> recursively call itself when it hits certain states.
I was wondering about that as well. I am not completely sure but to me it 
looks like its just done to reduce the amount of rules and states. 

I have to say that that code is not exactly clear and well documented...

Andres


pgsql-hackers by date:

Previous
From: James Mansion
Date:
Subject: Re: Listen / Notify rewrite
Next
From: Bernd Helmle
Date:
Subject: Re: ALTER ROLE/DATABASE RESET ALL versus security