pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marek Florianczyk <franki@tpi.pl>
Cc: pgsql-admin@postgresql.org
Subject: Re: performance problem - 10.000 databases
Date: Wed, 05 Nov 2003 12:59:49 -0500
Message-ID: <3453.1068055189@sss.pgh.pa.us> (raw)
In-Reply-To: <1068039213.28814.116.camel@franki-laptop.tpi.pl>
References: <1067594647.22286.57.camel@franki-laptop.tpi.pl>
	<9643.1067610219@sss.pgh.pa.us>
	<1068039213.28814.116.camel@franki-laptop.tpi.pl>

Marek Florianczyk <franki@tpi.pl> writes:
> Each client was doing:

> 10 x connect,"select * from table[rand(1-4)] where
> number=[rand(1-1000)]",disconnect--(fetch one row)

Seems like this is testing the cost of connect and disconnect to the
exclusion of nearly all else.  PG is not designed to process just one
query per connection --- backend startup is too expensive for that.
Consider using a connection-pooling module if your application wants
short-lived connections.

> I noticed that queries like: "\d table1" "\di" "\dp" are extremly slow,

I thought maybe you'd uncovered a performance issue with lots of
schemas, but I can't reproduce it here.  I made 10000 schemas each
containing a table "mytab", which is about the worst case for an
unqualified "\d mytab", but it doesn't seem excessively slow --- maybe
about a quarter second to return the one mytab that's actually in my
search path.  In realistic conditions where the users aren't all using
the exact same table names, I don't think there's an issue.

			regards, tom lane



view thread (50+ messages)  latest in thread

Message-ID: <3453.1068055189@sss.pgh.pa.us>
Permalink:  ../3453.1068055189@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3453.1068055189@sss.pgh.pa.us

 · 

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, franki@tpi.pl
  Subject: Re: performance problem - 10.000 databases
  In-Reply-To: <3453.1068055189@sss.pgh.pa.us>
  References: <1067594647.22286.57.camel@franki-laptop.tpi.pl> <9643.1067610219@sss.pgh.pa.us> <1068039213.28814.116.camel@franki-laptop.tpi.pl> <3453.1068055189@sss.pgh.pa.us>

* 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