Re: [PERFORM] Current query of the PL/pgsql procedure.

2013-12-18 Thread Guillaume Lelarge
On Mon, 2013-12-16 at 11:42 +, Yuri Levinsky wrote: Dear Depesz, This is very problematic solution: I have to change whole!!! my code to put appropriate comment with query text before any query execution. In addition I would like to know current execution plan, that seems to be

[PERFORM] Re: Problem with slow query with WHERE conditions with OR clause on primary keys

2013-12-18 Thread David Johnston
kolsze...@gmail.com wrote Thanx for your answer My example is trivial because i want to show strange (for me) postgres behavior with dealing with primary keys (extreme example), in real situation user put search condition e.g. Panas and this generates query ... where gd.other_code like

Re: [PERFORM] Problem with slow query with WHERE conditions with OR clause on primary keys

2013-12-18 Thread Andreas Karlsson
On 12/11/2013 12:30 AM, Krzysztof Olszewski wrote: select g.gd_index, gd.full_name from gd g join gd_data gd on (g.id_gd = gd.id_gd) where gd.id_gd_data = OR g.id_gd = ; Have you tried writing the query to filter on gd.id_gd rather than g.id_gd? I am not sure if the query planner