Re: What is faster?

From: "ON(dot)KG" <skyer(at)on(dot)kg>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: What is faster?
Date: 2005-06-07 07:28:26
Message-ID: 52585625.20050607112826@on.kg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2005-06-07 08:05:09 Re: to listadmin
Previous Message Kenneth Gonsalves 2005-06-07 07:00:16 to listadmin