Re: [PERFORM] runtime of the same query in function differs on 2

2003-10-03 Thread Andriy Tkachuk
No: the function is calc_total(int,int,int) and the table have the same types. As Tom said that my problem is because of planning in pl/pgsql. As is written in http://www.postgresql.org/docs/7.3/static/plpgsql.html#PLPGSQL-OVERVIEW plans for queries in pl/pgsql are made just once - when they are

Re: [PERFORM] runtime of the same query in function differs on 2 degree!

2003-10-02 Thread Gaetano Mendola
Andriy Tkachuk wrote: Hi folks. What's wrong with planner that executes my query in function?: (i mean no explanation but runtime) tele=# EXPLAIN analyze select calc_total(6916799, 1062363600, 1064955599); QUERY PLAN

Re: [PERFORM] runtime of the same query in function differs on 2 degree!

2003-10-02 Thread Tom Lane
Andriy Tkachuk <[EMAIL PROTECTED]> writes: > What's wrong with planner that executes my query in function?: > tele=# EXPLAIN analyze select sum(cost) from bills where (parent(user_id) = 6916799 > or user_id = 6916799) and dat >= 1062363600 and dat < 10649555 > 99; In the function case, the plann

[PERFORM] runtime of the same query in function differs on 2 degree!

2003-10-02 Thread Andriy Tkachuk
Hi folks. What's wrong with planner that executes my query in function?: (i mean no explanation but runtime) tele=# EXPLAIN analyze select calc_total(6916799, 1062363600, 1064955599); QUERY PLAN -