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

From Tom Lane
Subject Re: how to speed up query
Date
Msg-id 15000.1181758984@sss.pgh.pa.us
Whole thread Raw
In response to Re: how to speed up query  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: how to speed up query  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
"Andrus" <kobruleht2@hot.ee> writes:
> from pgAdmin, it takes 1 second.
> When I run this command from script it takes 11 minutes!

> Any idea why running this command from script takes 11 minutes?

Different plans maybe?  Try EXPLAIN ANALYZE in both cases.
Do you have work_mem set the same in both cases?

> My script in running in single transaction.
> Should I use commit after index creation or after ANALYZE command?

Hmm, there are some extra cycles involved in examining not-yet-committed
tuples, but I hardly see how that would create a discrepancy of this
size.  Check the plans first.

            regards, tom lane

pgsql-general by date:

Previous
From: Ben
Date:
Subject: changing the /tmp/ lock file?
Next
From: Tom Lane
Date:
Subject: Re: changing the /tmp/ lock file?