Re: Full text search with ORDER BY performance issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 20, 2009 at 9:35 PM, Krade<krade@xxxxxxxxx> 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 ?

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux