[SQL] select slows from 3 seconds to 30 seconds

2007-05-04 Thread Gary Stainburn
Hi folks. I have the query below which when run takes approx 3 seconds. However when I add the condition 'and w_ws_id = 10' onto the end changes to 30+ seconds. Can anyone see why? I've included the explain for the long select. select w_vin as key, w_vin, v_o_number as vista, v_status,

Re: [SQL] Insert into VIEW using RULE. Not possible to use nextval()?

2007-05-04 Thread Collin Peters
Hi Richard, Your situation is the same as mine. The only difference is that I actually had a call to nextval() in the actual call to the VIEW. In your case this would be something like "INSERT INTO Vschematic_insert(...". So if you were to try "INSERT INTO Vschematic_insert(nextval('foo_sql'),

Re: [SQL] Insert into VIEW using RULE. Not possible to use nextval()?

2007-05-04 Thread Richard Broersma Jr
--- Collin Peters <[EMAIL PROTECTED]> wrote: > 2. currval() is guaranteed to be correct within the RULE. This was my > second question. If I call "INSERT INTO Vschematic_insert(..." > simultaneously 1000 times is it guaranteed to be correct? To illistrate using psudo code: //This will always w

Re: [SQL] select slows from 3 seconds to 30 seconds

2007-05-04 Thread Tom Lane
Gary Stainburn <[EMAIL PROTECTED]> writes: > I have the query below which when run takes approx 3 seconds. However when I > add the condition 'and w_ws_id = 10' onto the end changes to 30+ seconds. > Can anyone see why? I've included the explain for the long select. You really ought to provide EX