X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9E06FD1B586 for ; Wed, 5 Nov 2003 18:00:40 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 86317-02 for ; Wed, 5 Nov 2003 14:00:10 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 5F624D1B524 for ; Wed, 5 Nov 2003 14:00:09 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hA5Hxn19003454; Wed, 5 Nov 2003 12:59:49 -0500 (EST) To: Marek Florianczyk Cc: pgsql-admin@postgresql.org Subject: Re: performance problem - 10.000 databases 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> Comments: In-reply-to Marek Florianczyk message dated "05 Nov 2003 14:33:33 +0100" Date: Wed, 05 Nov 2003 12:59:49 -0500 Message-ID: <3453.1068055189@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/67 X-Sequence-Number: 11055 Marek Florianczyk 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