[GENERAL] How does PostgerSQL planner decide driving table

2014-10-05 Thread Shingo horiuchi
Dear All, I have read about query tuning and attempt to check the impact of exchanging the driving table in Join condition. To test Simple Join condition, I prepared Two tables. One is the table for employees and another is the table for departments. Employees table has the foreign key whi

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Andy Colson
On 10/05/2014 10:00 AM, Adrian Klaver wrote: On 10/05/2014 07:37 AM, Tim Mickelson wrote: Sorry about that, the precise version is: "PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit" Well 9.1 is at .14 now, so on general principles i

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Adrian Klaver
On 10/05/2014 07:37 AM, Tim Mickelson wrote: Sorry about that, the precise version is: "PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit" Well 9.1 is at .14 now, so on general principles it would be a good idea to upgrade. That being

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Andy Colson
On 10/05/2014 09:37 AM, Tim Mickelson wrote: Sorry about that, the precise version is: "PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit" On 05/10/2014 15:54, Adrian Klaver wrote: On 10/05/2014 04:03 AM, Tim Mickelson wrote: I can g

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Tim Mickelson
Sorry about that, the precise version is: "PostgreSQL 9.1.9 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-3), 64-bit" On 05/10/2014 15:54, Adrian Klaver wrote: > On 10/05/2014 04:03 AM, Tim Mickelson wrote: >> I can guarantee that there is no entry in channel_m

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Adrian Klaver
On 10/05/2014 04:03 AM, Tim Mickelson wrote: I can guarantee that there is no entry in channel_mapping with idaut = 1622, it is first deleted. I've double checked, also because the error is indicating precisely this. The Postgresql Version is 9.1 FYI, when supplying the version number please in

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Tim Mickelson
I can guarantee that there is no entry in channel_mapping with idaut = 1622, it is first deleted. I've double checked, also because the error is indicating precisely this. The Postgresql Version is 9.1 On 04/10/2014 16:00, Adrian Klaver wrote: > On 10/03/2014 10:45 PM, Tim Mickelson wrote: >> But

Re: [GENERAL] Really strange foreign key constraint problem blocking delete

2014-10-05 Thread Tim Mickelson
Postgresql 9.1 On 04/10/2014 16:06, Andy Colson wrote: > On 10/04/2014 12:45 AM, Tim Mickelson wrote: >> But I don't think so, but here are the table defenitions: >> >> >> CREATE TABLE bulldog.channel_mapping >> ( >>idchannel integer NOT NULL, >>idaut integer NOT NULL, >>CONSTRAINT ch