how to make this database / query faster - Mailing list pgsql-general

From mark
Subject how to make this database / query faster
Date
Msg-id 82fa9e310803151621j5cb1bd05nf04f85d3d8b70363@mail.gmail.com
Whole thread Raw
Responses Re: how to make this database / query faster  ("Richard Broersma" <richard.broersma@gmail.com>)
Re: how to make this database / query faster  (Volkan YAZICI <yazicivo@ttmail.com>)
List 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!
Attachment

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Loging of postgres requests
Next
From: Terry Fielder
Date:
Subject: Re: Loging of postgres requests