Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1B862475AFA for ; Fri, 13 Dec 2002 11:37:36 -0500 (EST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 260A4474E61 for ; Fri, 13 Dec 2002 11:37:35 -0500 (EST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 1C0C1D61D; Fri, 13 Dec 2002 08:37:40 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 11D035C02; Fri, 13 Dec 2002 08:37:40 -0800 (PST) Date: Fri, 13 Dec 2002 08:37:40 -0800 (PST) From: Stephan Szabo To: "Ing. Gabriel Monsalvo" Cc: Subject: Re: Database Server is too Slow In-Reply-To: <002a01c2a2b6$fa1a9970$4d00a8c0@77> Message-ID: <20021213083413.N23623-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/180 X-Sequence-Number: 6675 On Fri, 13 Dec 2002, Ing. Gabriel Monsalvo wrote: > Hi! > I need help, i mounted a Postgresql server on IBM netserver with RAID 5 134 GB, 2.5 GB de RAM and two Xeon 1.4 ghz. > I installed postgresql 7.3 in this box, my database have over 25 millons of records, and everything is slow. > i optimized with indexes,vacuum analyze and tuning up the kernel for shared memory usage. > but the server is too slow when: > - create index for any table with more than 5 millions > - vacuum takes over four hours in this type of tables. > - select max (field) from table where field2=xxxx takes a lot of time. > > explain select max(numoble) from obligacion where periodo=200100; For this sort of query, I'd suggest trying select numoble from obligaction where periodo=200100 order by periodo desc, numoble desc limit 1; with an index on (periodo, numoble) (I think). You can see messages about max and min in the archives for me information.