Re: [GENERAL] Slow query with join

2015-03-17 Thread Marc Watson
Update : My query SELECT * FROM v_actor JOIN f_intervenant_ref ON (actor_id = ir_actor_id) WHERE ir_dos_id = '5226' took 7 secs. If I substitute the _RETURN rule for the view and add the above join, it takes 31 ms. Mark Watson Service au client - R&D Tél. 418 659-7272 ou 1 888 692-1050 www.j

Re: [GENERAL] Slow query with join

2015-03-17 Thread Marc Watson
>-Message d'origine- >De : Tom Lane [mailto:t...@sss.pgh.pa.us] >Envoyé : March-16-15 5:07 PM >À : Tomas Vondra >Cc : pgsql-general@postgresql.org; Marc Watson >Objet : Re: [GENERAL] Slow query with join > >Tomas Vondra writes: >> On 16.3.2015 19:50, Ma

Re: [GENERAL] Slow query with join

2015-03-16 Thread Tom Lane
Tomas Vondra writes: > On 16.3.2015 19:50, Marc Watson wrote: >> I hope someone can help me with a problem I'm having when joining a >> view with a table. The view is somewhat involved, but I can provide the >> details if necessary > First, get rid of the ORDER BY clauses in the subselects - it's

Re: [GENERAL] Slow query with join

2015-03-16 Thread Tomas Vondra
On 16.3.2015 19:50, Marc Watson wrote: > Hello all, > I am using PostgreSQL 9.4.1, compiled by Visual C++ build 1800, 64-bit, as downloaded from EnterpriseDB, and is running on my dev system under Win 7 64-bit. > I hope someone can help me with a problem I'm having when joining a view with a table.

Re: [GENERAL] Slow query with join

2015-03-16 Thread David G. Johnston
On Mon, Mar 16, 2015 at 11:50 AM, Marc Watson wrote: > Hello all, > I am using PostgreSQL 9.4.1, compiled by Visual C++ build 1800, 64-bit, as > downloaded from EnterpriseDB, and is running on my dev system under Win 7 > 64-bit. > ​[...]​ > > However, when I combine the two queries into one, th

[GENERAL] Slow query with join

2015-03-16 Thread Marc Watson
Hello all, I am using PostgreSQL 9.4.1, compiled by Visual C++ build 1800, 64-bit, as downloaded from EnterpriseDB, and is running on my dev system under Win 7 64-bit. I hope someone can help me with a problem I'm having when joining a view with a table. The view is somewhat involved, but I can