EXPLAIN ANALYZE VERBOSE SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from infogis_admin WHERE (feat_type='GEMEINDE') and (the_geom && setSRID( 'BOX3D(10.0976912562163 51.6005810254548,13.4185945311196 52.6039103320119)'::BOX3D,4326) ) Nested Loop (cost=42.12..48.17 rows=1 width=36) (actual time=57767.000..1412026.000 rows=303 loops=1) Join Filter: (("outer".the_geom && "inner".the_geom) AND contains("inner".the_geom, "outer".the_geom)) -> Index Scan using geom_admingebiete on admingebiete a (cost=0.00..6.02 rows=1 width=36) (actual time=0.000..761.000 rows=1002 loops=1) Index Cond: (the_geom && '0103000020E61000000100000005000000BC1B9D96043224409876CBD6DFCC4940BC1B9D960432244093DA0AEF4C4D4A40E3E2BA0552D62A4093DA0AEF4C4D4A40E3E2BA0552D62A409876CBD6DFCC4940BC1B9D96043224409876CBD6DFCC4940'::geometry) Filter: ((feat_type)::text = 'GEMEINDE'::text) -> Subquery Scan b (cost=42.12..42.13 rows=1 width=32) (actual time=1398.389..1398.672 rows=1 loops=1002) -> Aggregate (cost=42.12..42.12 rows=1 width=32) (actual time=1398.264..1398.264 rows=1 loops=1002) -> Index Scan using idx_admingebiete_gid, idx_admingebiete_gid, idx_admingebiete_gid, idx_admingebiete_gid, idx_admingebiete_gid, idx_admingebiete_gid, idx_admingebiete_gid on admingebiete (cost=0.00..42.10 rows=7 width=32) (actual time=0.016..0.061 rows=7 loops=1002) Index Cond: ((gid = 410) OR (gid = 422) OR (gid = 423) OR (gid = 424) OR (gid = 426) OR (gid = 427) OR (gid = 430)) Total runtime: 1412026.000 ms QUERY PLAN {NESTLOOP :startup_cost 42.12 :total_cost 48.17 :plan_rows 1 :plan_width 36 :targetlist ( {TARGETENTRY :resdom {RESDOM :resno 1 :restype 17 :restypmod -1 :resname asbinary :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {FUNCEXPR :funcid 18105 :funcresulttype 17 :funcretset false :funcformat 0 :args ( {FUNCEXPR :funcid 18181 :funcresulttype 17984 :funcretset false :funcformat 0 :args ( {FUNCEXPR :funcid 18176 :funcresulttype 17984 :funcretset false :funcformat 0 :args ( {VAR :varno 65001 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 7 } ) } ) } {CONST :consttype 25 :constlen -1 :constbyval false :constisnull false :constvalue 7 [ 7 0 0 0 78 68 82 ] } ) } } {TARGETENTRY :resdom {RESDOM :resno 2 :restype 25 :restypmod -1 :resname oid :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {FUNCEXPR :funcid 114 :funcresulttype 25 :funcretset false :funcformat 1 :args ( {VAR :varno 65001 :varattno 2 :vartype 26 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno -2 } ) } } ) :qual <> :lefttree {INDEXSCAN :startup_cost 0.00 :total_cost 6.02 :plan_rows 1 :plan_width 36 :targetlist ( {TARGETENTRY :resdom {RESDOM :resno 1 :restype 17984 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 4 :varattno 7 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 7 } } {TARGETENTRY :resdom {RESDOM :resno 2 :restype 26 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 4 :varattno -2 :vartype 26 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno -2 } } ) :qual ( {OPEXPR :opno 98 :opfuncid 67 :opresulttype 16 :opretset false :args ( {RELABELTYPE :arg {VAR :varno 4 :varattno 4 :vartype 1043 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 4 } :resulttype 25 :resulttypmod -1 :relabelformat 0 } {CONST :consttype 25 :constlen -1 :constbyval false :constisnull false :constvalue 12 [ 12 0 0 0 71 69 77 69 73 78 68 69 ] } ) } ) :lefttree <> :righttree <> :initPlan <> :extParam (b) :allParam (b) :nParamExec 0 :scanrelid 4 :indxid (o 120573) :indxqual (( {OPEXPR :opno 18056 :opfuncid 18046 :opresulttype 16 :opretset false :args ( {VAR :varno 4 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 7 } {CONST :consttype 17984 :constlen -1 :constbyval false :constisnull false :constvalue 113 [ 113 0 0 0 -61 36 -112 33 65 -2 102 78 66 -111 -7 8 86 65 104 106 82 66 -26 16 0 0 1 0 0 0 5 0 0 0 -68 27 -99 -106 4 50 36 64 -104 118 -53 -42 -33 -52 73 64 -68 27 -99 -106 4 50 36 6 4 -109 -38 10 -17 76 77 74 64 -29 -30 -70 5 82 -42 42 64 -109 -38 10 -17 76 77 74 64 -29 -30 -70 5 82 -42 42 64 -104 118 -53 -42 -33 -52 73 64 -68 27 -99 -106 4 50 36 64 -104 118 -53 -42 -33 -52 73 64 ] } ) } )) :indxqualorig (( {OPEXPR :opno 18056 :opfuncid 18046 :opresulttype 16 :opretset false :args ( {VAR :varno 4 :varattno 7 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 7 } {CONST :consttype 17984 :constlen -1 :constbyval false :constisnull false :constvalue 113 [ 113 0 0 0 -61 36 -112 33 65 -2 102 78 66 -111 -7 8 86 65 104 106 82 66 -26 16 0 0 1 0 0 0 5 0 0 0 -68 27 -99 -106 4 50 36 64 -104 118 -53 -42 -33 -52 73 64 -68 27 -99 -106 4 50 36 6 4 -109 -38 10 -17 76 77 74 64 -29 -30 -70 5 82 -42 42 64 -109 -38 10 -17 76 77 74 64 -29 -30 -70 5 82 -42 42 64 -104 118 -53 -42 -33 -52 73 64 -68 27 -99 -106 4 50 36 64 -104 118 -53 -42 -33 -52 73 64 ] } ) } )) :indxstrategy ((i 3)) :indxsubtype ((o 0)) :indxlossy ((i 1)) :indxorderdir 0 } :righttree {SUBQUERYSCAN :startup_cost 42.12 :total_cost 42.13 :plan_rows 1 :plan_width 32 :targetlist ( {TARGETENTRY :resdom {RESDOM :resno 1 :restype 17984 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 5 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 5 :varoattno 1 } } ) :qual <> :lefttree <> :righttree <> :initPlan <> :extParam (b) :allParam (b) :nParamExec 0 :scanrelid 5 :subplan {AGG :startup_cost 42.12 :total_cost 42.12 :plan_rows 1 :plan_width 32 :targetlist ( {TARGETENTRY :resdom {RESDOM :resno 1 :restype 17984 :restypmod -1 :resname the_geom :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {AGGREF :aggfnoid 18327 :aggtype 17984 :target {VAR :varno 0 :varattno 7 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 7 } :agglevelsup 0 :aggstar false :aggdistinct false } } ) :qual <> :lefttree {INDEXSCAN :startup_cost 0.00 :total_cost 42.10 :plan_rows 7 :plan_width 32 :targetlist ( {TARGETENTRY :resdom {RESDOM :resno 1 :restype 23 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } } {TARGETENTRY :resdom {RESDOM :resno 2 :restype 20 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 2 :vartype 20 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 2 } } {TARGETENTRY :resdom {RESDOM :resno 3 :restype 1043 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 3 :vartype 1043 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 3 } } {TARGETENTRY :resdom {RESDOM :resno 4 :restype 1043 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 4 :vartype 1043 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 4 } } {TARGETENTRY :resdom {RESDOM :resno 5 :restype 1043 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 5 :vartype 1043 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 5 } } {TARGETENTRY :resdom {RESDOM :resno 6 :restype 1043 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 6 :vartype 1043 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 6 } } {TARGETENTRY :resdom {RESDOM :resno 7 :restype 17984 :restypmod -1 :resname <> :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false } :expr {VAR :varno 3 :varattno 7 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 7 } } ) :qual <> :lefttree <> :righttree <> :initPlan <> :extParam (b) :allParam (b) :nParamExec 0 :scanrelid 3 :indxid (o 120574 120574 120574 120574 120574 120574 120574) :indxqual (( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -102 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -90 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -89 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -88 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -86 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -85 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -82 1 0 0 ] } ) } )) :indxqualorig (( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -102 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -90 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -89 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -88 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -86 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -85 1 0 0 ] } ) } ) ( {OPEXPR :opno 96 :opfuncid 65 :opresulttype 16 :opretset false :args ( {VAR :varno 3 :varattno 1 :vartype 23 :vartypmod -1 :varlevelsup 0 :varnoold 3 :varoattno 1 } {CONST :consttype 23 :constlen 4 :constbyval true :constisnull false :constvalue 4 [ -82 1 0 0 ] } ) } )) :indxstrategy ((i 3) (i 3) (i 3) (i 3) (i 3) (i 3) (i 3)) :indxsubtype ((o 0) (o 0) (o 0) (o 0) (o 0) (o 0) (o 0)) :indxlossy ((i 0) (i 0) (i 0) (i 0) (i 0) (i 0) (i 0)) :indxorderdir 0 } :righttree <> :initPlan <> :extParam (b) :allParam (b) :nParamExec 0 :aggstrategy 0 :numCols 0 :numGroups 0 } } :initPlan <> :extParam (b) :allParam (b) :nParamExec 0 :jointype 0 :joinqual ( {OPEXPR :opno 18056 :opfuncid 18046 :opresulttype 16 :opretset false :args ( {VAR :varno 65001 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 7 } {VAR :varno 65000 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 5 :varoattno 1 } ) } {FUNCEXPR :funcid 18335 :funcresulttype 16 :funcretset false :funcformat 0 :args ( {VAR :varno 65000 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 5 :varoattno 1 } {VAR :varno 65001 :varattno 1 :vartype 17984 :vartypmod -1 :varlevelsup 0 :varnoold 4 :varoattno 7 } ) } ) }