[postgis-users] Incremental retrieval of data from DB

Richard Gomes rgomes1997 at yahoo.co.uk
Sun Apr 10 04:13:38 PDT 2011


Hi,

You could assign a timestamp to every record you create in the database.
When you click on a button, you only have to read those records since a 
certain timestamp, which is exactly the timestamp of the last time you 
pressed that button.

Another similar concept would be assigning version numbers to records: 
everytime you store information in the database, you have a version 
number associated to it. Please look for STM (software transactional 
memory) for more information about this. You can implement a deadly 
simple versioning policy simply employing a SERIAL datatype and making 
sure that everything happens in a transactional scope.

The advantage of STM over timestamps is that timestamps maybe not be 
convenient in certain scenarios, due to inaccuracy inherent to time 
measurements (leap seconds) , time zones and daytime savings.

I hope it helps

Richard Gomes
http://www.jquantlib.org/index.php/User:RichardGomes
twitter: frgomes

JQuantLib is a library for Quantitative Finance written in Java.
http://www.jquantlib.com/
twitter: jquantlib


On 09/04/11 21:36, vikashvikky wrote:
> Hi frnds,
>
>          I am using Postgis as my backend for my project along with geoserver
> and openlayers. I have a table in my DB which gets filled up very
> frequently.  Now when a user gets connected to a server , he can see the map
> with all the markers whose points are in the DB. Imagine the table keeps on
> filling up and there is no relation between user viewing the map and tables
> getting filled by values. Now suppose after some time when user clicks on
> certain button on the page, he has to see the map with markers of all the
> values present in the DB(along with new points inserted in the table since
> last time he clicked that button). This task can be made simple by making
> that button as submit button, but when the user clicks it, it reads the
> entire DB again(reloads the page) along with old points and projects on the
> map, instead of reading only the new points. This method is not at all good
> when I have 10000 points already in DB and only say 5 points getting added
> in the meantime. In this case it reads all the 10005 points instead of only
> 5 points.
>
> So can anybody give me a solution on how to retrieve only the new points,
> still projecting all the points present in DB. To my knowledge Ajax can be
> used to do the same(which doesnt need reloading of the page) but I want a
> clear explanation of how to carry this work using postgis and geoserver. Are
> there any special functions which can handle this?? If not, what is the
> better way to do this?
>
> Thanking you in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110410/6daa69fb/attachment.html>


More information about the postgis-users mailing list