Re: [PERFORM] In progress INSERT wrecks plans on table

2013-05-10 Thread Mark Kirkwood
On 11/05/13 01:30, Tom Lane wrote: Mark Kirkwood writes: Unfortunately a trigger will not really do the job - analyze ignores in progress rows (unless they were added by the current transaction), and then the changes made by analyze are not seen by any other sessions. So no changes to plans unt

Re: [PERFORM] PostgreSQL planner

2013-05-10 Thread Misa Simic
On Friday, May 10, 2013, Robert Haas wrote: > On Sat, Mar 23, 2013 at 8:12 PM, Misa Simic > > > wrote: > > but problem is - we don't know the thing id - we know calc_id: > > > > EXPLAIN ANALYZE > > SELECT * FROM t2_left_t3_volatile v INNER JOIN t1 USING (thing_id) > > WHERE calc_id = 20 > > With

Re: [PERFORM] PostgreSQL planner

2013-05-10 Thread Robert Haas
On Sat, Mar 23, 2013 at 8:12 PM, Misa Simic wrote: > but problem is - we don't know the thing id - we know calc_id: > > EXPLAIN ANALYZE > SELECT * FROM t2_left_t3_volatile v INNER JOIN t1 USING (thing_id) > WHERE calc_id = 20 With this query you've got to scan all three tables. The calc_id qual

Re: [PERFORM] In progress INSERT wrecks plans on table

2013-05-10 Thread Tom Lane
Mark Kirkwood writes: > Unfortunately a trigger will not really do the job - analyze ignores in > progress rows (unless they were added by the current transaction), and > then the changes made by analyze are not seen by any other sessions. So > no changes to plans until the entire INSERT is com

Re: [PERFORM] In progress INSERT wrecks plans on table

2013-05-10 Thread Mark Kirkwood
(See below for the reply) On 10/05/13 22:48, Vitalii Tymchyshyn wrote: Well, could you write a trigger that would do what you need? AFAIR analyze data is stored no matter transaction boundaries. You could store some counters in session vars and issue an explicit analyze when enough rows were add

Re: [PERFORM] In progress INSERT wrecks plans on table

2013-05-10 Thread Vitalii Tymchyshyn
Well, could you write a trigger that would do what you need? AFAIR analyze data is stored no matter transaction boundaries. You could store some counters in session vars and issue an explicit analyze when enough rows were added. 7 трав. 2013 08:33, "Mark Kirkwood" напис. > On 07/05/13 18:10, Simo