Rodrigo Madera wrote:
I have a system that does this. We do it by PK, the PK is bigint, and always increases, the client remembers the last key seen as queries based on that key... select ... where events.event_id > ?::bigint order by events.event_id limit 2000 it works, but when alot of data is added, it can become sensative to the index statistics getting out of sync with the data. Best to insert, then update the statistics, then read the data. For us these three activities are independent, but it still seems to work. I'd investigate the notify mechanism suggested by Otto if you can afford to use a postgres specific mechanism like that. David |
- Re: [PERFORM] Best way to check for new data. David Roussel
- Re: [PERFORM] Best way to check for new data. Merlin Moncure