Re: [PERFORM] Trivial function query optimized badly

2007-01-03 Thread Craig A. James
Tom Lane wrote: "Craig A. James" <[EMAIL PROTECTED]> writes: CREATE OR REPLACE FUNCTION cansmiles(text) RETURNS text AS '/usr/local/pgsql/lib/libchem.so', 'cansmiles' LANGUAGE 'C' STRICT IMMUTABLE; Umm ... this is a single-argument function. db=> explain analyze select version_id, 'Brc

Re: [PERFORM] Trivial function query optimized badly

2007-01-03 Thread Tom Lane
"Craig A. James" <[EMAIL PROTECTED]> writes: > CREATE OR REPLACE FUNCTION cansmiles(text) RETURNS text > AS '/usr/local/pgsql/lib/libchem.so', 'cansmiles' > LANGUAGE 'C' STRICT IMMUTABLE; Umm ... this is a single-argument function. > db=> explain analyze select version_id, 'Brc1ccc2nc(cn2c1

Re: [PERFORM] Trivial function query optimized badly

2007-01-03 Thread Craig A. James
Adam Rich wrote: Craig, What version of postgres are you using? I just tested this on PG 8.1.2 and was unable to reproduce these results. I wrote a simple function that returns the same text passed to it, after sleeping for 1 second. I use it in a where clause, like your example below, and rega

Re: [PERFORM] Trivial function query optimized badly

2007-01-03 Thread Adam Rich
Craig, What version of postgres are you using? I just tested this on PG 8.1.2 and was unable to reproduce these results. I wrote a simple function that returns the same text passed to it, after sleeping for 1 second. I use it in a where clause, like your example below, and regardless of the numb

[PERFORM] Trivial function query optimized badly

2007-01-03 Thread Craig A. James
Well, once again I'm hosed because there's no way to tell the optimizer the cost for a user-defined function. I know this issue has already been raised (by me!) several times, but I have to remind everyone about this. I frequently must rewrite my SQL to work around this problem. Here is the

Re: [PERFORM] Performance of PostgreSQL on Windows vs Linux

2007-01-03 Thread Dimitri Fontaine
Le jeudi 4 janvier 2007 00:18, Magnus Hagander a écrit : > But to get a good answer on if the difference is > significant enough to matter, you really need to run some kind of simple > benchmark on *your* workload. To easily stress test a couple of servers and compare results on *your* workload,

Re: [PERFORM] Performance of PostgreSQL on Windows vs Linux

2007-01-03 Thread Magnus Hagander
Jeremy Haile wrote: > I am sure that this has been discussed before, but I can't seem to find > any recent posts. (I am running PostgreSQL 8.2) > > I have always ran PostgreSQL on Linux in the past, but the company I am > currently working for uses Windows on all of their servers. I don't > have

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Erik Jones
Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: That's a good idea, but first I'll still need to run it by my sysadmin wrt space -- our dump files are around 22GB when we can let them finish these days. Given that we're now speculating about regex problems, you could do a test

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > That's a good idea, but first I'll still need to run it by my sysadmin > wrt space -- our dump files are around 22GB when we can let them finish > these days. Given that we're now speculating about regex problems, you could do a test run of "pg_dump -s" w

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Erik Jones
Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: Guillaume Smet wrote: Could you set log_min_duration_statement=0 on your server and enable Heh, unfortunately, setting log_min_duration_statement=0 would be a total last resort as the last we counted (2 months ago) we w

[PERFORM] Performance of PostgreSQL on Windows vs Linux

2007-01-03 Thread Jeremy Haile
I am sure that this has been discussed before, but I can't seem to find any recent posts. (I am running PostgreSQL 8.2) I have always ran PostgreSQL on Linux in the past, but the company I am currently working for uses Windows on all of their servers. I don't have the luxury right now of running

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > Guillaume Smet wrote: >> Could you set log_min_duration_statement=0 on your server and enable > Heh, unfortunately, setting log_min_duration_statement=0 would be a > total last resort as the last we counted (2 months ago) we were doing > approximately 3 m

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Erik Jones
Guillaume Smet wrote: Erik, Could you set log_min_duration_statement=0 on your server and enable logging (tutorial here if you don't know how to do that: http://pgfouine.projects.postgresql.org/tutorial.html). You should see which queries are executed in both cases and find the slow one easily.

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Erik Jones
Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: Tom Lane wrote: I could see this taking an unreasonable amount of time if you had a huge number of pg_class rows or a very long search_path --- is your database at all out of the ordinary in those ways? Well, running "selec

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I could see this taking an unreasonable amount of time if you had a huge >> number of pg_class rows or a very long search_path --- is your database >> at all out of the ordinary in those ways? >> > Well, running "select count(*) from pg_c

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Guillaume Smet
Erik, Could you set log_min_duration_statement=0 on your server and enable logging (tutorial here if you don't know how to do that: http://pgfouine.projects.postgresql.org/tutorial.html). You should see which queries are executed in both cases and find the slow one easily. Regards, -- Guillaum

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Erik Jones
Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: ... sigaction(SIGPIPE, 0x08046E20, 0x08046E70) = 0 send(4, " Q\0\0\0E5 S E L E C T ".., 230, 0) = 230 <--- Hang is right here! sigaction(SIGPIPE, 0x08046E20, 0x08046E70

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Tom Lane
Erik Jones <[EMAIL PROTECTED]> writes: > ... > sigaction(SIGPIPE, 0x08046E20, 0x08046E70) = 0 > send(4, " Q\0\0\0E5 S E L E C T ".., 230, 0) = 230 > <--- Hang is > right here! > sigaction(SIGPIPE, 0x08046E20, 0x08046E70) = 0

Re: [PERFORM] More 8.2 client issues (Was: [Slow dump?)

2007-01-03 Thread Erik Jones
Tom Lane wrote: Erik Jones <[EMAIL PROTECTED]> writes: Hmm... This gets stranger and stranger. When connecting to the database with the psql client in 8.2's bin directory and using commands such as \d the client hangs, or takes an extremely long time. Hangs at what point? During co

Re: [PERFORM] Worse perfomance on 8.2.0 than on 7.4.14

2007-01-03 Thread Tom Lane
=?iso-8859-1?q?Rolf=20=D8stvik?= <[EMAIL PROTECTED]> writes: > Index Scan using step_result_uut_result_idx on step_result_subset > (cost=0.00..563.85 rows=23 > width=4) (actual time=0.069..0.069 rows=0 loops=1) >Index Cond: (uut_result = $1) >Filter: (step_parent = 0) > Total runtime: 0

Re: [PERFORM] Worse perfomance on 8.2.0 than on 7.4.14

2007-01-03 Thread Rolf Østvik
--- Tom Lane <[EMAIL PROTECTED]> skrev: > > Please --- I'm still curious why the estimated cost changed so much from > 7.4 to 8.2. I can believe a marginal change in cost leading to a plan Is this the output you need? logistics_82=# prepare foo(int) as select id from step_result_subset where