Re: tsearch 2 query

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: Matthew Terenzio <mterenzio(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: tsearch 2 query
Date: 2008-10-02 16:32:05
Message-ID: Pine.LNX.4.64.0810022031060.15810@sn.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

ok,

you calculate headline() 19861 times, while you need only 20.
Use subselect and will be surprized

Oleg
On Thu, 2 Oct 2008, Matthew Terenzio wrote:

> Thanks Tom, Sorry if that last post went over multiple times. I was getting
> a mailing failure (or so I thought)
>
> here is EXPLAIN ANALYZE . I really need to work on my skills at analyzing
> these:
>
> Limit (cost=105505.78..105505.83 rows=20 width=655) (actual
> time=74806.973..74807.037 rows=20 loops=1)
>
> -> Sort (cost=105505.78..105555.44 rows=19861 width=655) (actual
> time=74806.968..74806.989 rows=20 loops=1)
>
> Sort Key: stories."timestamp"
>
> -> Nested Loop (cost=0.00..90497.94 rows=19861 width=655)
> (actual time=720.251..74798.672 rows=680 loops=1)
>
> -> Function Scan on q (cost=0.00..12.50 rows=1000
> width=32) (actual time=0.013..0.017 rows=1 loops=1)
>
> -> Index Scan using description_index on stories
> (cost=0.00..90.14 rows=20 width=623) (actual time=700.633..63243.713
> rows=680 loops=1)
>
> Index Cond: (stories.vectors @@ "outer".q)
>
> Total runtime: 74847.177 ms
>

Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2008-10-02 17:40:17 Re: Transactions within a function body
Previous Message Oleg Bartunov 2008-10-02 16:28:05 Re: tsearch2 query