On Wed, Aug 4, 2010 at 3:16 AM, Heiko L. <heikol@fh-lausitz.de> wrote:
> $ echo "EXPLAIN ANALYSE $sql2" | $cmd 2>&1
> Aggregate (cost=5236.53..5236.54 rows=1 width=0) (actual time=2018.985..2018.9
> 86 rows=1 loops=1)
> -> Seq Scan on blacklist (cost=0.00..4855.06 rows=152588 width=0) (actual t
> ime=0.329..1883.275 rows=152603 loops=1)
> Filter: (create_time < ((((timenow())::integer - 3000))::abstime)::time
> stamp with time zone)
> Total runtime: 2019.371 ms
Maybe you need an index on create_time.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company