Skip site navigation (1) Skip section navigation (2)

Re: Full text search with ORDER BY performance issue

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Krade <krade(at)krade(dot)com>
Cc: Devin Ben-Hur <dbenhur(at)whitepages(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Full text search with ORDER BY performance issue
Date: 2009-07-21 04:06:49
Message-ID: dcc563d10907202106k6eb9d968hb2b623aa6ecf147c@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Mon, Jul 20, 2009 at 9:35 PM, Krade<krade(at)krade(dot)com> wrote:

> But I think I might just do:
> select * from a where comment_tsv @@ plainto_tsquery('query') and timestamp
>> cast(floor(extract(epoch from CURRENT_TIMESTAMP) - 864000) as integer)
> order by timestamp desc limit 24 offset 0;
>
> And if I get less than 24 rows, issue the regular query:
>
> select * from a where comment_tsv @@ plainto_tsquery('query') order by
> timestamp desc limit 24 offset 0;

Couldn't you do tge second query as a with query then run another
query to limit that result to everything greater than now()-xdays ?

In response to

Responses

pgsql-performance by date

Next:From: valgogDate: 2009-07-21 10:32:39
Subject: Re: Full text search with ORDER BY performance issue
Previous:From: KradeDate: 2009-07-21 03:35:11
Subject: Re: Full text search with ORDER BY performance issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group