X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id BBD5E528DD for ; Mon, 6 Jun 2005 12:02:16 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 04868-03 for ; Mon, 6 Jun 2005 15:02:06 +0000 (GMT) Received: from mail.aknet.kg (aknet.kg [212.112.96.1]) by svr1.postgresql.org (Postfix) with ESMTP id 0276152851 for ; Mon, 6 Jun 2005 12:02:02 -0300 (ADT) Received: (qmail 27136 invoked by uid 91); 6 Jun 2005 15:01:59 -0000 Received: from 212.112.107.15 by mail.aknet.kg (envelope-from , uid 82) with qmail-scanner-1.23st (spamassassin: 2.64. perlscan: 1.23st. Clear:RC:1(212.112.107.15):. Processed in 0.031801 secs); 06 Jun 2005 15:01:59 -0000 X-Qmail-Scanner-Mail-From: skyer@on.kg via mail.aknet.kg X-Qmail-Scanner: 1.23st (Clear:RC:1(212.112.107.15):. Processed in 0.031801 secs Process 27131) Received: from unknown (HELO MainComputer) (212.112.107.15) by mail.aknet.kg with SMTP; 6 Jun 2005 15:01:59 -0000 Date: Mon, 6 Jun 2005 21:02:13 +0400 From: "ON.KG" X-Mailer: The Bat! (v2.01) Reply-To: "ON.KG" Organization: UnCLouds X-Priority: 3 (Normal) Message-ID: <15836788703.20050606210213@on.kg> To: Richard Huxton Cc: pgsql-sql Subject: Re: What is faster? In-Reply-To: <42A4616E.8070101@archonet.com> References: <42A43791.7030306@archonet.com> <17434586625.20050606202531@on.kg> <42A4616E.8070101@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.345 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, HOT_NASTY X-Spam-Level: X-Archive-Number: 200506/83 X-Sequence-Number: 21684 Hi All! >> What is faster - SLECTion data from one large table (200 000 - 300 000 >> records), or SELECTion from a few small tables (example, 2 tables 150 >> 000 records each)? RH> It depends. Are you selecting all records? One record? A few records? If RH> one or a few, do you have a suitable index on the table(s)? Is the table RH> clustered? Expected to be cached in RAM? RH> Do you have a specific problem, or reason to believe you may encounter one? It's a real problem For example i have two large tables Structure of tables is same - has two fields - id, ip Now i'm using two selection from each in one transaction Each of them selects only one record selection clase like WHERE ip = 'xxx.xxx.xxx.xxx' so it is searches existance of IP in each table tables are clustered about cached in RAM - i'm novice in Postgresql - how does it work? now i need to make much faster as it is possible and have an idea just merge two tables in one - will it help me? Thank You