[PERFORM] Postgres8.0 Planner chooses WRONG plan.

2006-01-13 Thread Pallav Kalva
Hi , I am having problem optimizing this query, Postgres optimizer uses a plan which invloves seq-scan on a table. And when I choose a option to disable seq-scan it uses index-scan and obviously the query is much faster. All tables are daily vacummed and analyzed as per docs. Why

[PERFORM] Postgres8.0 planner chooses WRONG plan

2006-01-11 Thread Pallav Kalva
Hi , I am having problem optimizing this query, Postgres optimizer uses a plan which invloves seq-scan on a table. And when I choose a option to disable seq-scan it uses index-scan and obviously the query is much faster. All tables are daily vacummed and analyzed as per docs. Why cant

Re: [PERFORM] Postgres8.0 planner chooses WRONG plan

2006-01-11 Thread Tom Lane
Pallav Kalva [EMAIL PROTECTED] writes: I am having problem optimizing this query, Get rid of the un-optimizable function inside the view. You've converted something that should be a join into an unreasonably large number of function calls. - Seq Scan on serviceinstance

Re: [PERFORM] Postgres8.0 planner chooses WRONG plan

2006-01-11 Thread Pallav Kalva
Hi Tom, Thanks! for your input, the view was written first without using the function but its an ugly big with all the joins and its much slower that way. Below is the view without the function and its explain analzye output , as you can see the it takes almost 2 min to run this query

Re: [PERFORM] Postgres8.0 planner chooses WRONG plan

2006-01-11 Thread Jim C. Nasby
On Wed, Jan 11, 2006 at 11:44:58AM -0500, Pallav Kalva wrote: Some view you've got there... you might want to break that apart into multiple views that are a bit easier to manage. service_instance_with_status is a likely candidate, for example. View Definition --- create or