[postgis-users] Too many results

Greg Williamson gwilliamson39 at yahoo.com
Tue Apr 14 04:16:45 PDT 2009


Jim --

Can we see the SQL and table/index defintions (or something close, anyway) ? The limit won't help much if the database has to process all x-thousand tuples before deciding it has the number needed. Are you using an "order by" clause ?

If you can run the query in an EXPLAIN ANALYZE statement (wrap it in a transaction and roll it back when done if it does any updates etc. that you don't want to keep) ... this will take longer than the regular evaluation because of the timing calls but gives useful information about what the planner is doing.

HTH,

Greg Williamson





________________________________
From: Jim Jim <gamecleaner at hotmail.com>
To: postgis-users at postgis.refractions.net
Sent: Tuesday, April 14, 2009 2:00:29 AM
Subject: [postgis-users] Too many results

 Hello,

I have a table with 2d points and lines. My query is a rectangle and a line. The problem is there are too many results to the point where it becomes non-practical to wait. So I wanted to limit the results. I know that this can be done by LIMIT N, however, this does not stop searching after finding N results and the whole point is not to wait too long.

Do you have any ideas on how this could be accomplished? I suppose when it comes to intersections and geometrical problems this is quite important.

Thank you!

________________________________
Get the New Internet Explore 8 Optimised for MSN. Download Now


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090414/cdccdd26/attachment.html>


More information about the postgis-users mailing list