Re: very slow search
Oleg Bartunov <
oleg@...>
2005-06-29 11:53:43 GMT
On Tue, 28 Jun 2005, Uro Gruber wrote:
> Hi!
>
> I need some help to solve problem with slow searching. I have many tables
> with ts index but only one makes troubles. This is table description
>
> --------------+-----------------------------+-----------------------
> id_news | integer | not null
> title | character varying(255) | not null
> flash | character varying(1024) | not null
> link | character varying(128) |
> id_category | integer | not null
> id_publisher | character varying | not null
> picture | character varying(64) |
> published | timestamp without time zone | not null
> is_visible | boolean | not null default true
> created | timestamp without time zone |
> body | text |
> tsidx | tsvector |
> Indeksi:
> "news_item_pkey" PRIMARY KEY, btree (id_news)
> "id_publisher_idx" btree (id_publisher)
> "is_visible_idx" btree (is_visible)
> "tsidx_idx" gist (tsidx)
>
> and here is query explain
>
> explain analyze SELECT id_news, title, flash, published, picture FROM
> news_item WHERE tsidx <at> <at> to_tsquery('simple','janez');
> QUERY PLAN
> ---------------------------------------------------------------------------------------------------------------------------
> Index Scan using tsidx_idx on news_item (cost=0.00..97.99 rows=9 width=400)
> (actual time=4.503..849.755 rows=84 loops=1)
> Index Cond: (tsidx <at> <at> '\'janez\''::tsquery)
> Total runtime: 850.065 ms
>
>
> select count(*) from news_item;
> count
> -------
> 1933
>
> I don't know why searching takes so much time. Because other tables has more
> than 60.000 rows and searching is done in 10 or 20 ms.
>
> What can I check or change to make this work faster. I speed up a little with
> vacuum full, because there vas a lot of deleting. I use postgresql 8.0.3 and
> tsearch2 in contrib
Uro, what if you repeat your query several times ? Are you sure you created
tsidx column using 'simple' dictionary ?
>
> regards
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> OpenFTS-general mailing list
> OpenFTS-general@...
> https://lists.sourceforge.net/lists/listinfo/openfts-general
>
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@..., http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click