Re: full text search to_tsquery performance with ispell dictionary - Mailing list pgsql-general

From Tom Lane
Subject Re: full text search to_tsquery performance with ispell dictionary
Date
Msg-id 24675.1305121705@sss.pgh.pa.us
Whole thread Raw
In response to full text search to_tsquery performance with ispell dictionary  (Stanislav Raskin <raskin@livn.de>)
Responses Re: full text search to_tsquery performance with ispell dictionary  (Stanislav Raskin <raskin@livn.de>)
List pgsql-general
Stanislav Raskin <raskin@livn.de> writes:
> The problem is, that if I open a new connection to the database and do
> something like this
> SELECT to_tsquery('german_de', 'abcd');
> it takes A LOT of time for the query to complete for the first time. About
> 1-1,5s. If I submit the same query for a second, third, fourth time and so
> on, it takes only some 10-20ms, which is what I would expect.

> It almost seems as if the dictionary is somehow analyzed or indexed and the
> results cached for each connection, which seems counter-intuitive to me.

Yes, loading a large dictionary is known to be a fairly expensive
operation.  There's been discussions about how to make it cheaper, but
nothing's been done yet.

            regards, tom lane

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: full text search to_tsquery performance with ispell dictionary
Next
From: Dave Cramer
Date:
Subject: Re: Custom types and JDBC