pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: nickf@ontko.com
To: shridhar_daithankar@persistent.co.in
To: Pgsql-Performance@Postgresql. Org <pgsql-performance@postgresql.org>
Subject: Re: Sanity check requested
Date: Thu, 17 Jul 2003 08:57:08 -0700
Message-ID: <200307170857.08837.josh@agliodbs.com> (raw)
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGAEFBHMAA.nickf@ontko.com>
References: <NEBBLAAHGLEEPCGOBHDGAEFBHMAA.nickf@ontko.com>

Nick,

> I'll try that approach while testing. Is it the case that the sort memory
> is allocated for each connection and becomes unavailable to other processes
> while the connection exists? If so, since I'm using a connection pool, I
> should be able to control total usage precisely. Without a connection pool,
> I could start starving the rest of the system for resources if the number
> of users spiked unexpectedly. Correct?

Wrong, actually.   Sort memory is allocated *per sort*, not per connnection or 
per query.   So a single complex query could easily use 4xsort_mem if it has 
several merge joins ... and a pooled connection could use many times sort_mem 
depending on activity.  Thus connection pooling does not help you with 
sort_mem usage at all, unless your pooling mechanism can control the rate at 
which queries are fed to the planner.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



view thread (16+ messages)  latest in thread

Message-ID: <200307170857.08837.josh@agliodbs.com>
Permalink:  ../200307170857.08837.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200307170857.08837.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: josh@agliodbs.com, nickf@ontko.com, shridhar_daithankar@persistent.co.in
  Subject: Re: Sanity check requested
  In-Reply-To: <200307170857.08837.josh@agliodbs.com>
  References: <NEBBLAAHGLEEPCGOBHDGAEFBHMAA.nickf@ontko.com> <200307170857.08837.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox