[BUGS] BUG #6335: Weird planner decision with exists (a join b) condition

2011-12-14 Thread maxim . boguk
The following bug has been logged on the website: Bug reference: 6335 Logged by: Maksym Boguk Email address: maxim.bo...@gmail.com PostgreSQL version: 9.0.4 Operating system: Linux Ubuntu Description: I was explored reasons of high DB load and I localized the next pro

Re: [BUGS] BUG #6335: Weird planner decision with exists (a join b) condition

2011-12-14 Thread Alvaro Herrera
Excerpts from maxim.boguk's message of mié dic 14 08:09:38 -0300 2011: > But once I add second value into IN list plan become completely screwed: See here: http://archives.postgresql.org/message-id/1309918036-sup-4...@alvh.no-ip.org Perhaps it's a similar problem. Maybe you'd get enthused enoug

[BUGS] BUG #6336: SQL stored procedure returing 'int' calling into SRF does not raise error ...

2011-12-14 Thread jlrobins
The following bug has been logged on the website: Bug reference: 6336 Logged by: James Robinson Email address: jlrob...@socialserve.com PostgreSQL version: 9.1.2 Operating system: OSX Description: calling into generate_series() within a 'returns int' (singular) SQL st

Re: [BUGS] BUG #6334: initdb not working

2011-12-14 Thread Alvaro Herrera
Excerpts from Wilfried.Weiss's message of mié dic 14 03:36:25 -0300 2011: > The following bug has been logged on the website: > > Bug reference: 6334 > Logged by: Wilfried Weiss > Email address: wilfried.we...@nsg.com > PostgreSQL version: 9.1.2 > Operating system: AIX 5300-1

Re: [BUGS] BUG #6335: Weird planner decision with exists (a join b) condition

2011-12-14 Thread Maxim Boguk
Here goes self-contained test case. I tested it on the 9.1.2, 9.1.1, 9.0.5, 9.0.4, 8.4.7 all of them affected by the problem: select version(); drop table if exists test1; drop table if exists test2; drop table if exists test3; CREATE TABLE test1 AS SELECT user_id FROM generate_series(1,100)

Re: [BUGS] BUG #6335: Weird planner decision with exists (a join b) condition

2011-12-14 Thread bricklen
On Wed, Dec 14, 2011 at 4:53 PM, Maxim Boguk wrote: > Here goes self-contained test case. > > I tested it on the 9.1.2, 9.1.1, 9.0.5, 9.0.4, 8.4.7 I just tested on 9.1.2 and see the same issue. > --bad > EXPLAIN ANALYZE  select * > from test1 > where > test1.user_id in (100, 101) > and exists (

Re: [BUGS] BUG #6335: Weird planner decision with exists (a join b) condition

2011-12-14 Thread Maxim Boguk
On Thu, Dec 15, 2011 at 12:00 PM, bricklen wrote: > On Wed, Dec 14, 2011 at 4:53 PM, Maxim Boguk > wrote: > > Here goes self-contained test case. > > > > I tested it on the 9.1.2, 9.1.1, 9.0.5, 9.0.4, 8.4.7 > > I just tested on 9.1.2 and see the same issue. > > > --bad > > EXPLAIN ANALYZE selec

Re: [BUGS] BUG #6336: SQL stored procedure returing 'int' calling into SRF does not raise error ...

2011-12-14 Thread Kevin Grittner
wrote: > calling into generate_series() within a 'returns int' (singular) > SQL stored function doesn't raise error (plpgsql does): > > -- SQL function elides over fact that generate_series() is a SRF > create function foo_sql() > returns int as > $$ > select * from generate_series(1,5) > $$ lan