[PERFORM] Postgres 8.x on Windows Server in production

2009-04-10 Thread Ognjen Blagojevic
Hi all, What are your experiences with Postgres 8.x in production use on Windows Server 2003/2008? Are there any limitations, trade-offs or quirks? My client is accustomed to Windows Server environment, but it seems hard to google good information about these types of installations. Regards

Re: [PERFORM] Nested query performance issue

2009-04-10 Thread Tom Lane
Glenn Maynard writes: > http://www.postgresql.org/docs/8.3/static/xfunc-sql.html says this is > deprecated (though no deprecation warning is being generated): >> Currently, functions returning sets can also be called in the select list of >> a query. For each row that the query generates by itse

Re: [PERFORM] Shouldn't the planner have a higher cost for reverse index scans?

2009-04-10 Thread Tom Lane
Josh Berkus writes: > Now, what that says to me is that for this system reverse sequential > reads are 1/4 the speed of forwards reads. And from my testing > elsewhere, that seems fairly typical of disk systems in general. Well, that's because filesystems try to lay out files so that logically

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Joshua D. Drake
On Fri, 2009-04-03 at 17:09 -0700, Josh Berkus wrote: > On 4/3/09 4:12 PM, Josh Berkus wrote: > > All, > > > > I've been using Bonnie++ for ages to do filesystem testing of new DB > > servers. But Josh Drake recently turned me on to IOZone. > > Related to this: is IOZone really multi-threaded? I'

Re: [PERFORM] Shouldn't the planner have a higher cost for reverse index scans?

2009-04-10 Thread Josh Berkus
Tom, Now, while index scans (for indexes on disk) aren't 100% sequential reads, it seems like we should be increasing (substantially) the estimated cost of reverse index scans if the index is likely to be on disk. No? AFAICS this is already folded into random_page_cost. Not as far as I can

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Josh Berkus
On 4/9/09 11:26 PM, Mark Kirkwood wrote: Josh Berkus wrote: All, Wow, am I really the only person here who's used IOZone? No - I used to use it exclusively, but everyone else tended to demand I redo stuff with bonnie before taking any finding seriously... so I've kinda 'submitted to the Borg

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Scott Carey
I've switched to using FIO. Bonnie in my experience produces poor results and is better suited to testing desktop/workstation type load. Most of its tests don't apply to how postgres writes/reads anyway. IOZone is a bit more troublesome to get it to work on the file(s) you want under concurrency

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Josh Berkus
JD, In order to test real interactivity (AFAIK) with iozone you have to launch multiple iozone instances. You also need to do them from separate directories, otherwise it all starts writing the same file. The work I did here: Actually, current IOZone allows you to specify multiple files. For

Re: [PERFORM] Shouldn't the planner have a higher cost for reverse index scans?

2009-04-10 Thread Tom Lane
Josh Berkus writes: > Not as far as I can tell. It looks to me like the planner is assuming > that a forwards index scan and a reverse index scan will have the same > cost. Right, because they do. If you think otherwise, demonstrate it. (bonnie tests approximating a reverse seqscan are not r

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Josh Berkus
Scott, FIO with profiles such as the below samples are easy to set up, and they can be mix/matched to test what happens with mixed read/write seq/rand -- with surprising and useful tuning results. Forcing a cache flush or sync before or after a run is trivial. Changing to asynchronous I/O, dir

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Scott Carey
On 4/10/09 10:31 AM, "Josh Berkus" wrote: > Scott, > >> FIO with profiles such as the below samples are easy to set up, and they can >> be mix/matched to test what happens with mixed read/write seq/rand -- with >> surprising and useful tuning results. Forcing a cache flush or sync before >> or

Re: [PERFORM] Shouldn't the planner have a higher cost for reverse index scans?

2009-04-10 Thread Josh Berkus
Tom, Right, because they do. If you think otherwise, demonstrate it. (bonnie tests approximating a reverse seqscan are not relevant to the performance of indexscans.) Working on it. I *think* I've seen this issue in the field, which is why I brought it up in the first place, but getting a g

Re: [PERFORM] plpgsql arrays

2009-04-10 Thread Tom Lane
Matthew Wakeling writes: > On Tue, 7 Apr 2009, Tom Lane wrote: >> Subsequent discussion showed that the problem was Matthew hadn't found >> that page. I guess that at least the DECLARE CURSOR reference page >> ought to have something like "if you are trying to use cursors in >> plpgsql, see ". M

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Greg Smith
On Fri, 10 Apr 2009, Scott Carey wrote: FIO with profiles such as the below samples are easy to set up There are some more sample FIO profiles with results from various filesystems at http://wiki.postgresql.org/wiki/HP_ProLiant_DL380_G5_Tuning_Guide -- * Greg Smith gsm...@gregsmith.com htt

Re: [PERFORM] Postgres 8.x on Windows Server in production

2009-04-10 Thread Josh Berkus
Ognjen, What are your experiences with Postgres 8.x in production use on Windows Server 2003/2008? Are there any limitations, trade-offs or quirks? First of all, you need to know that the first *two* digits of a PostgreSQL version are major version numbers. So 8.3 is not the same Postgres w

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Scott Carey
On 4/10/09 11:01 AM, "Greg Smith" wrote: > On Fri, 10 Apr 2009, Scott Carey wrote: > >> FIO with profiles such as the below samples are easy to set up > > There are some more sample FIO profiles with results from various > filesystems at > http://wiki.postgresql.org/wiki/HP_ProLiant_DL380_G5_T

[PERFORM] determining the locks that will be held by a query

2009-04-10 Thread Brian Cox
I sent this out on 4/7 and either missed a response or didn't get one. If this is the wrong forum, I'd appreciate a redirect. I know that EXPLAIN will show the query plan. I know that pg_locks will show the locks currently held for activity transactions. Is there a way to determine what locks a

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread Greg Smith
On Fri, 10 Apr 2009, Scott Carey wrote: I wish to thank Greg here as many of my profile variations came from the above as a starting point. That page was mainly Mark Wong's work, I just remembered where it was. -- * Greg Smith gsm...@gregsmith.com http://www.gregsmith.com Baltimore, MD -- Se

Re: [PERFORM] determining the locks that will be held by a query

2009-04-10 Thread Kevin Grittner
Brian Cox wrote: > I know that EXPLAIN will show the query plan. I know that pg_locks > will show the locks currently held for activity transactions. Is > there a way to determine what locks a query will hold when it is > executed? Only to read the docs regarding locking, and to desk-check your

[PERFORM] 2.6.26 kernel and PostgreSQL

2009-04-10 Thread Glyn Astill
Hi chaps, Is anyone using 2.6.26 with postgres? I was thinking about shifting my home test machine up from 2.6.18, however I recall reading a post somewhere a while back about the scheduler in more recent versions being a bit cranky... I just thought I'd ask before I go ahead, I don't have to

Re: [PERFORM] 2.6.26 kernel and PostgreSQL

2009-04-10 Thread Kevin Grittner
Glyn Astill wrote: > I was thinking about shifting my home test machine up from 2.6.18, > however I recall reading a post somewhere a while back about the > scheduler in more recent versions being a bit cranky... A recent post on the topic: http://archives.postgresql.org/pgsql-performance/200

Re: [PERFORM] Postgres 8.x on Windows Server in production

2009-04-10 Thread Grzegorz Jaśkiewicz
On Fri, Apr 10, 2009 at 7:07 PM, Josh Berkus wrote: > Yet 1000's of users are running PostgreSQL on Windows in production.  It > really depends on what kind of application you're running, and what its > demands are.  For a CMS or a contact manager or a personnel directory? No > problem.  For a cen

Re: [PERFORM] 2.6.26 kernel and PostgreSQL

2009-04-10 Thread Glyn Astill
--- On Fri, 10/4/09, Kevin Grittner wrote: > Glyn Astill wrote: > > I was thinking about shifting my home test machine up > from 2.6.18, > > however I recall reading a post somewhere a while back > about the > > scheduler in more recent versions being a bit > cranky... > > A recent post o

Re: [PERFORM] Using IOZone to simulate DB access patterns

2009-04-10 Thread M. Edward (Ed) Borasky
I've done quite a bit with IOzone, but if you're on Linux, you have lots of options. In particular, you can actually capture I/O patterns from a running application with blktrace, and then replay them with btrecord / btreplay. The documentation for this stuff is a bit hard to find. Some of the dis