[postgis-users] Benshmark postgis

Paul Ramsey pramsey at opengeo.org
Thu Nov 25 09:22:54 PST 2010


Depends on who you think the results will be valid for. The
countries-of-the-world is a somewhat non-standard GIS collection given
the wide variation in polygon sizes, the large numbers of vertices in
the larger polygons, and the extreme coverage of the overall area that
the bounding boxes of the larger polygons command. In many ways your
test of "against the whole world" will be largely a test of "against
Russia, Canada, Brazil, and the USA"

Data matters,

P


On Thu, Nov 25, 2010 at 9:16 AM, Arnaud Vandecasteele
<arnaud.sig at gmail.com> wrote:
 Hi all,
>
> I've to do a quick benchmark  of postgis. The case is to check if a
> point is inside (or not) a polygon.
> To do so, I've uploaded in my database a big shapefile which contains
> all the world's countries.
> After that I've made a simple stored function [1]. This one, take two
> arguments :
> 1 - The number of points to check
> 2 - The number of polygon to check
>
> Then I run the query and i change the number of iterations or the
> number of feature.
>
> Do you think it's a good way to have some pertinents results ?
>
>
> Best regards
>
> Arnaud
>
>
> [1]
> -- Function: random_poi(integer, integer)
>
> -- DROP FUNCTION random_poi(integer, integer);
>
> CREATE OR REPLACE FUNCTION random_poi(integer, integer)
>  RETURNS void AS
> $BODY$
> DECLARE
>        iteration alias for $1;
>        nb_feat alias for $2;
>        pt_x numeric;
>        pt_y numeric;
>        geom_poi geometry;
>        i int := 0;
> BEGIN
>        WHILE i < iteration LOOP
>                i := i + 1;
>                -- CREATE RANDOM POSITION
>                pt_x := random()*100;
>                pt_y := random()*100;
>                -- CREATE RANDOM GEOM POI
>                geom_poi := ST_GeometryFromText(text 'POINT('||pt_x||' '||pt_y||')');
>                PERFORM ST_CONTAINS(geom_poi, the_geom) FROM world_poly LIMIT nb_feat;
>        END LOOP;
>        return;
> END;
> $BODY$
>  LANGUAGE 'plpgsql' IMMUTABLE STRICT
>  COST 100;
> ALTER FUNCTION random_poi(integer, integer) OWNER TO postgres;
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list