Re: What is faster?

Поиск
Список
Период
Сортировка
От Achilleus Mantzios
Тема Re: What is faster?
Дата
Msg-id Pine.LNX.4.44.0506070937590.16686-100000@matrix.gatewaynet.com
обсуждение исходный текст
Ответ на Re: What is faster?  ("ON.KG" <skyer@on.kg>)
Список pgsql-sql
O ON.KG έγραψε στις Jun 7, 2005 :

> 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

Just a thought, also you could try if converting your ip from varchar(32)
to int8 (unsigned int4) would make any difference, since
the index on int8 would be more efficient.

> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
> 

-- 
-Achilleus



В списке pgsql-sql по дате отправления:

Предыдущее
От: Kenneth Gonsalves
Дата:
Сообщение: Re: preventing deletion of a row
Следующее
От: Kenneth Gonsalves
Дата:
Сообщение: to listadmin