Re: how to speed up query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Andrus" <kobruleht2(at)hot(dot)ee>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to speed up query
Date: 2007-06-13 18:23:04
Message-ID: 15000.1181758984@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andrus" <kobruleht2(at)hot(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karen Springer 2007-06-13 18:24:04 recursive function
Previous Message yyyc186 2007-06-13 18:09:45 Re: Fault Tolerant Postgresql (two machines, two postmasters, one disk array)