Re: [PERFORM] pl/pgsql faster than raw SQL?

2005-03-09 Thread Gaetano Mendola
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 John A Meinel wrote: > That sounds more like you had bad statistics on the field1 column, which > caused postgres to switch from a seqscan to an index scan, only there > were so many rows with field1='New' that it actually would have been > faster wit

Re: [PERFORM] pl/pgsql faster than raw SQL?

2005-03-08 Thread John A Meinel
Gaetano Mendola wrote: Markus Bertheau â wrote: Hi, I have the following strange situation: that is no so strange. I have an example where: SELECT * FROM my_view WHERE field1 = 'New'; ==> 800 seconds SELECT * FROM my_view; ==> 2 seconds the only solution I had was to write a function table

Re: [PERFORM] pl/pgsql faster than raw SQL?

2005-03-08 Thread Gaetano Mendola
Markus Bertheau â wrote: > Hi, I have the following strange situation: that is no so strange. I have an example where: SELECT * FROM my_view WHERE field1 = 'New'; ==> 800 seconds SELECT * FROM my_view; ==> 2 seconds the only solution I had was to write a function table with the second select i

Re: [PERFORM] pl/pgsql faster than raw SQL?

2005-03-08 Thread John A Meinel
Markus Bertheau â wrote: Hi, I have the following strange situation: ... oocms=# explain analyze select count(1) from objects where class = 'Picture'; QUERY PLAN

Re: [PERFORM] pl/pgsql faster than raw SQL?

2005-03-08 Thread Richard Huxton
Markus Bertheau â wrote: oocms=# explain analyze select count(1) from objects where class = 'Picture'; QUERY PLAN Aggregate (cost=278

[PERFORM] pl/pgsql faster than raw SQL?

2005-03-08 Thread Markus Bertheau ☭
Hi, I have the following strange situation: oocms=# vacuum full analyze; VACUUM oocms=# \df+ class_get_number_of_objects ÐÐÐÑÐÐ ÑÑÐÐÑÐÐ ÐÑÐÐÐ | ÐÐÑ | ÐÐÐ ÑÑ ÑÐÐÑÐÑÑ