Re: full text search to_tsquery performance with ispell dictionary

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stanislav Raskin <raskin(at)livn(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: full text search to_tsquery performance with ispell dictionary
Date: 2011-05-11 13:48:25
Message-ID: 24675.1305121705@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Stanislav Raskin <raskin(at)livn(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Cramer 2011-05-11 13:52:02 Re: Custom types and JDBC
Previous Message Pavel Stehule 2011-05-11 13:45:55 Re: full text search to_tsquery performance with ispell dictionary