<div dir="ltr"><div><div><div>Hello,<br><br></div>I am using Mapserver to serve WMS to a browser based application using Openlayers as the client-side library. The map is a hexagonal grid of a country, I have divided the whole area into a unique (q,r) hexagonal co-ordinate system, and the postgis DB has the hexagons stored in a table as POLYGONs. When the user clicks on a grid, it executes a query on another table with additional data (linked via hexagon grid id) to retrieve data about that particular grid. All tables have appropriate indexing.  The tables are two in number - one with the hexagon as POLYGON (around 50M) and the other with the actual points under each gridbox as POINT (around 400M).<br>
<br></div>Is there some way to make the data retrieval from the hexagon POLYGON table faster using the unique hexgrid ID? I can convert between lat/lon and hexgridid, so I was wondering if I could get the maps current view's bounds, convert it to the bounding hexgrids and send that as WMS paramaters and somehow set a limit on the search grid? I am hoping this would speed up the mapserver query if it was possible somehow to bound the output with hexagon gridid in addition to the standard lat/lon bounding query mapserver sends. Or is that just not a good idea? <br>
<br></div>Thanks,<br>Arun<br></div>