Re: What is faster? - Mailing list pgsql-sql

From ON.KG
Subject Re: What is faster?
Date
Msg-id 15836788703.20050606210213@on.kg
Whole thread Raw
In response to Re: What is faster?  (Richard Huxton <dev@archonet.com>)
Responses Re: What is faster?
List pgsql-sql
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



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: What is faster?
Next
From: Joe Conway
Date:
Subject: Re: ARRAY() returning NULL instead of ARRAY[] resp. {}