how to make this database / query faster

Поиск
Список
Период
Сортировка
От mark
Тема how to make this database / query faster
Дата
Msg-id 82fa9e310803151621j5cb1bd05nf04f85d3d8b70363@mail.gmail.com
обсуждение исходный текст
Ответы Re: how to make this database / query faster
Re: how to make this database / query faster
Список pgsql-general
Hi
I use postgres v 8.3 on a dual quad core, intel xeon e5405@2.00GHz, fedora core 8 x86_64, and 32GB RAM

settings i changed on postgresql.conf:

shared_buffers = 1000MB                 # min 128kB or max_connections*16kB
effective_cache_size = 4000MB


I have a user table structure is attached and I have around 2 million rows and adding like 10k-30k rows everyday..
id is the primary key, and i have an index session_key

i iterate through the users table like this

select * from users where session_key is not Null order by id offset OFFSET limit 300


i want to go through the whole table... it gets really slow like greater than 5 minutes when the OFFSET is over 500,000..

what is the best way to iterate through the whole table? should i increase the  limit?
thanks a lot!
Вложения

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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Loging of postgres requests
Следующее
От: Terry Fielder
Дата:
Сообщение: Re: Loging of postgres requests