I'm using Postgres 9.4.4 with Postgis 2.2.1., my issues is that i have about 3 million of points i want to fetch and display on a map with leaflet. The problem is that those are too many points, what is the best aproach to tackle the problem since fetching all the rows from the database is slow?
i have considered taking a bunch of random points and group the most closest one to those points but it might not be best.
Other solution i thougth is paginate all the points and fetching them by groups, since this would be faster that query all of them in one time, but not sure how to do this with Geoserver.
Any hints/ideas about this?