Re: [PERFORM] query has huge variance in execution times

2010-03-31 Thread David Wilson
On Wed, Mar 31, 2010 at 2:10 PM, Brian Cox wrote: > > > so the question still remains: why did it take > 20 mins? To see if it was > due to autovacuum running ANALYZE, I turned off autovacuum, created a table > using SELECT * INTO temp FROM ts_stats_tranunit_user_daily, added the index > on ts_in

Re: [PERFORM] query has huge variance in execution times

2010-03-31 Thread Brian Cox
On 03/31/2010 12:37 AM, David Wilson [david.t.wil...@gmail.com] wrote: These won't necessarily get the same plan. If you want to see what plan the prepared query is getting, you'll need to prepare it ("prepare foo as ") and then explain *that* via "explain execute foo". The prepared version like

Re: [PERFORM] query has huge variance in execution times

2010-03-30 Thread David Wilson
On Wed, Mar 31, 2010 at 12:11 AM, Brian Cox wrote: > > 2010-03-30 18:41:11.685261-07 | select b.ts_id from > ts_stats_tranunit_user_daily b, ts_stats_tranunit_user_interval c where > b.ts_transet_incarnation_id = c.ts_transet_incarnation_id and > b.ts_tranunit_id = c.ts_tranunit_id and b.ts_user

[PERFORM] query has huge variance in execution times

2010-03-30 Thread Brian Cox
postgres 8.3.5 on RHEL4 update 6 This query starts executing at 18:41: cemdb=> select query_start,current_query from pg_stat_activity where procpid=10022; query_start | current_query ---+-