[PERFORM] Big differences in plans between 8.0 and 8.1

2006-07-15 Thread Gabriele Turchi
Hi all. I have a strange (and serious) problem with an application ported from postgres 8.0 to 8.1. The old installation is postgresql-8.0.4-2.FC4.1 running on a Fedora 4, the new one is postgresql-8.1.4-1.FC5.1 running on a fedora 5. Some query is now _very_ slow. I've found some deep

[PERFORM] increment Rows in an SQL Result Set postgresql

2006-07-15 Thread Hassan Adekoya
HI, 1. I have a function that given two parameter produces an arbitrary id, and text. However arbitrary the id and text are, they are in certain order. i.e. it is imperative that whatever processing I do, the order is preserved. 2. An odd thing happens when I perform a join on the result set

Re: [PERFORM] increment Rows in an SQL Result Set postgresql

2006-07-15 Thread Craig A. James
Hassan, 1. I have a function that given two parameter produces an arbitrary id, and text. However arbitrary the id and text are, they are in certain order. i.e. it is imperative that whatever processing I do, the order is preserved. What type of function is this? Did you write it in C? An

Re: [PERFORM] increment Rows in an SQL Result Set postgresql

2006-07-15 Thread Hassan
Sadly I didnt write this function. It was written in C and packaged in a shared module .so. I access it thru postgresql as plpgsql function. I cannot edit the function thus. I tried this CREATE TEMPORARY SEQUENCE serial START 1; SELECT nextval('serial'), astext(tmp.the_geom), street

Re: [PERFORM] Big differences in plans between 8.0 and 8.1

2006-07-15 Thread Michael Fuhr
On Sat, Jul 15, 2006 at 04:14:11PM +0200, Gabriele Turchi wrote: Hi all. I have a strange (and serious) problem with an application ported from postgres 8.0 to 8.1. The old installation is postgresql-8.0.4-2.FC4.1 running on a Fedora 4, the new one is postgresql-8.1.4-1.FC5.1 running on a

Re: [PERFORM] Big differences in plans between 8.0 and 8.1

2006-07-15 Thread Gabriele Turchi
Il giorno sab, 15/07/2006 alle 13.02 -0600, Michael Fuhr ha scritto: On Sat, Jul 15, 2006 at 04:14:11PM +0200, Gabriele Turchi wrote: Hi all. I have a strange (and serious) problem with an application ported from postgres 8.0 to 8.1. The old installation is postgresql-8.0.4-2.FC4.1

Re: [PERFORM] Big differences in plans between 8.0 and 8.1

2006-07-15 Thread Joe Conway
Gabriele Turchi wrote: Running an ANALYZE really change the plan, now it is fast as before (8.0). On the production system a VACUUM FULL ANALYZE is run every morning after a clean-up, when the registrazioni table is empty. During the day this table fills up (about 500 record any day), and

Re: [PERFORM] Big differences in plans between 8.0 and 8.1

2006-07-15 Thread Gabriele Turchi
Il giorno sab, 15/07/2006 alle 13.04 -0700, Joe Conway ha scritto: Gabriele Turchi wrote: Running an ANALYZE really change the plan, now it is fast as before (8.0). On the production system a VACUUM FULL ANALYZE is run every morning after a clean-up, when the registrazioni table is

Re: [PERFORM] increment Rows in an SQL Result Set postgresql

2006-07-15 Thread Peter Eisentraut
Hassan Adekoya wrote: I will like to preserve ordering Tables are inherently unordered. If you want a particular order, you need to use the ORDER BY clause. And you will need to have a column to sort by. If you don't have one, the generate_series() function may help. This has nothing