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

From ON.KG
Subject Re: What is faster?
Date
Msg-id 52585625.20050607112826@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
RH> ON.KG wrote:
>> 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)?
>> 
>> 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

RH> OK - so the tables aren't updated frequently, I assume. Do you have an
RH> index on "ip"?

Yes

>> about cached in RAM - i'm novice in Postgresql - how does it work?

RH> The operating-system will keep frequently used disk-blocks in memory.
RH> You don't have to do anything. Have you done any performance tuning in
RH> your postgresql.conf file? If not, try reading:
RH>    http://www.powerpostgresql.com/PerfList

Server Administrator says, he did

>> 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?

RH> If they hold the same information, they probably shouldn't have been
RH> split in the first place.

Content of tables is not absolutely same
One has one kind of IPs, second - others

And there's one more addition in question - if I will merge tables,
in new table will be set new additional field - `type` char - to
determine type of IP

Thank You



pgsql-sql by date:

Previous
From: Markus Bertheau
Date:
Subject: Re: SQL equivalent to nested loop
Next
From: Kenneth Gonsalves
Date:
Subject: preventing deletion of a row