Re: how to speed up query - Mailing list pgsql-general

From Andrus
Subject Re: how to speed up query
Date
Msg-id f4j0kb$2cpm$1@news.hub.org
Whole thread Raw
In response to Re: how to speed up query  (Andrew Sullivan <ajs@crankycanuck.ca>)
List pgsql-general
> We don't know.  You don't tell us what version you're running, show
> us any EXPLAIN ANALYSE output, tell us about the data. . .

explain analyze delete from firma1.rid where dokumnr not in (select dokumnr
from firma1.dok)

produces

"Seq Scan on rid  (cost=7703.59..98570208.00 rows=101210 width=6) (actual
time=7269933.877..7269933.877 rows=0 loops=1)"
"  Filter: (NOT (subplan))"
"  SubPlan"
"    ->  Materialize  (cost=7703.59..8537.22 rows=55963 width=4) (actual
time=0.007..18.707 rows=25313 loops=202421)"
"          ->  Seq Scan on dok  (cost=0.00..7373.63 rows=55963 width=4)
(actual time=40.236..3353.985 rows=56079 loops=1)"
"Total runtime: 7269944.251 ms"

As I understand this took 2.2 hours to run

Andrus.


pgsql-general by date:

Previous
From: Gino.Barille@gmail.com
Date:
Subject: Re: Full vacuum may reclaim space
Next
From: Timasmith
Date:
Subject: how to enforce index usage with +0