qgis_list_geometry_columns.txt

Execution plan, result of EXPLAIN ANALYZE of the problematic query - Kirill Mueller, 2012-01-11 03:48 PM

Download (5.96 KB)

 
1
                                                                                   QUERY PLAN                                                                 
2
                   
3
--------------------------------------------------------------------------------------------------------------------------------------------------------------
4
-------------------
5
 Nested Loop  (cost=33350.33..40392.79 rows=13 width=193) (actual time=1073.299..171226.309 rows=4821 loops=1)
6
   ->  Nested Loop Anti Join  (cost=30586.95..37463.23 rows=1 width=133) (actual time=958.850..170675.643 rows=9343 loops=1)
7
         Join Filter: ((pg_namespace.nspname = (geometry_columns.f_table_schema)::name) AND (pg_class.relname = (geometry_columns.f_table_name)::name))
8
         ->  Hash Anti Join  (cost=30586.95..37075.41 rows=1 width=133) (actual time=945.911..1760.307 rows=17836 loops=1)
9
               Hash Cond: ((pg_namespace.nspname = n.nspname) AND (pg_class.relname = c.relname))
10
               ->  Hash Join  (cost=7.64..5076.89 rows=2426 width=133) (actual time=1.264..769.633 rows=17836 loops=1)
11
                     Hash Cond: (pg_class.relnamespace = pg_namespace.oid)
12
                     Join Filter: has_table_privilege((((('"'::text || (pg_namespace.nspname)::text) || '"."'::text) || (pg_class.relname)::text) || '"'::text
13
), 'select'::text)
14
                     ->  Seq Scan on pg_class  (cost=0.00..4802.82 rows=17676 width=73) (actual time=0.039..135.094 rows=17850 loops=1)
15
                           Filter: (relkind = ANY ('{v,r}'::"char"[]))
16
                     ->  Hash  (cost=6.85..6.85 rows=63 width=68) (actual time=1.172..1.172 rows=157 loops=1)
17
                           ->  Seq Scan on pg_namespace  (cost=0.00..6.85 rows=63 width=68) (actual time=0.027..0.938 rows=157 loops=1)
18
                                 Filter: has_schema_privilege((nspname)::text, 'usage'::text)
19
               ->  Hash  (cost=29919.24..29919.24 rows=44005 width=128) (actual time=944.583..944.583 rows=0 loops=1)
20
                     ->  Hash Join  (cost=5294.84..29919.24 rows=44005 width=128) (actual time=944.582..944.582 rows=0 loops=1)
21
                           Hash Cond: (a.attrelid = c.oid)
22
                           ->  Hash Join  (cost=19.75..22908.77 rows=94205 width=4) (actual time=944.580..944.580 rows=0 loops=1)
23
                                 Hash Cond: (a.atttypid = t.oid)
24
                                 ->  Seq Scan on pg_attribute a  (cost=0.00..19562.42 rows=635881 width=8) (actual time=0.007..582.303 rows=647146 loops=1)
25
                                       Filter: (NOT attisdropped)
26
                                 ->  Hash  (cost=19.70..19.70 rows=4 width=4) (actual time=0.039..0.039 rows=1 loops=1)
27
                                       ->  Bitmap Heap Scan on pg_type t  (cost=4.32..19.70 rows=4 width=4) (actual time=0.035..0.036 rows=1 loops=1)
28
                                             Recheck Cond: (typname = 'geography'::name)
29
                                             ->  Bitmap Index Scan on pg_type_typname_nsp_index  (cost=0.00..4.31 rows=4 width=0) (actual time=0.025..0.025 rows=1 loops=1)
30
                                                   Index Cond: (typname = 'geography'::name)
31
                           ->  Hash  (cost=5054.14..5054.14 rows=17676 width=132) (never executed)
32
                                 ->  Hash Join  (cost=8.28..5054.14 rows=17676 width=132) (never executed)
33
                                       Hash Cond: (c.relnamespace = n.oid)
34
                                       ->  Seq Scan on pg_class c  (cost=0.00..4802.82 rows=17676 width=72) (never executed)
35
                                             Filter: (relkind = ANY ('{r,v}'::"char"[]))
36
                                       ->  Hash  (cost=5.90..5.90 rows=190 width=68) (never executed)
37
                                             ->  Seq Scan on pg_namespace n  (cost=0.00..5.90 rows=190 width=68) (never executed)
38
         ->  Seq Scan on geometry_columns  (cost=0.00..211.94 rows=8794 width=43) (actual time=0.002..3.634 rows=6656 loops=17836)
39
   ->  Index Scan using pg_attribute_relid_attnum_index on pg_attribute  (cost=2763.38..2929.40 rows=13 width=68) (actual time=0.052..0.054 rows=1 loops=9343)
40
         Index Cond: (pg_attribute.attrelid = pg_class.oid)
41
         Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (hashed SubPlan 3))
42
         SubPlan 1
43
           ->  Index Scan using pg_type_oid_index on pg_type  (cost=0.00..8.28 rows=1 width=0) (never executed)
44
                 Index Cond: (oid = $0)
45
                 Filter: (typname = ANY ('{geometry,geography,topogeometry}'::name[]))
46
         SubPlan 2
47
           ->  Bitmap Heap Scan on pg_type  (cost=12.88..57.58 rows=12 width=4) (actual time=0.029..0.030 rows=2 loops=1)
48
                 Recheck Cond: (typname = ANY ('{geometry,geography,topogeometry}'::name[]))
49
                 ->  Bitmap Index Scan on pg_type_typname_nsp_index  (cost=0.00..12.88 rows=12 width=0) (actual time=0.021..0.021 rows=2 loops=1)
50
                       Index Cond: (typname = ANY ('{geometry,geography,topogeometry}'::name[]))
51
         SubPlan 3
52
           ->  Hash Semi Join  (cost=57.73..2629.03 rows=53739 width=4) (actual time=84.822..84.822 rows=0 loops=1)
53
                 Hash Cond: (a.typbasetype = b.oid)
54
                 ->  Seq Scan on pg_type a  (cost=0.00..1832.39 rows=53739 width=8) (actual time=0.021..54.158 rows=53878 loops=1)
55
                 ->  Hash  (cost=57.58..57.58 rows=12 width=4) (actual time=0.021..0.021 rows=2 loops=1)
56
                       ->  Bitmap Heap Scan on pg_type b  (cost=12.88..57.58 rows=12 width=4) (actual time=0.016..0.018 rows=2 loops=1)
57
                             Recheck Cond: (typname = ANY ('{geometry,geography,topogeometry}'::name[]))
58
                             ->  Bitmap Index Scan on pg_type_typname_nsp_index  (cost=0.00..12.88 rows=12 width=0) (actual time=0.012..0.012 rows=2 loops=1)
59
                                   Index Cond: (typname = ANY ('{geometry,geography,topogeometry}'::name[]))
60
 Total runtime: 171231.823 ms
61
(55 rows)
62