Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Plan now can generate plan

After parsing, you can call ->as_text() to get reformatted (created from
scratch) text format of the explain. This will be used by anonymization
feature.
  • Loading branch information...
commit 1bfe0e7b42c285621f625f9bd424626c5007ee0e 1 parent f64c67e
@depesz authored
View
49 t/17-as_text.t
@@ -0,0 +1,49 @@
+#!perl
+
+use Test::More;
+use Test::Deep;
+use Data::Dumper;
+use autodie;
+
+use Pg::Explain;
+
+my @tests = @ARGV;
+if (0 == scalar @tests) {
+ opendir( my $dir, 't/17-as_text' );
+
+ my %uniq = ();
+ @tests = sort { $a <=> $b }
+ grep { !$uniq{ $_ }++ }
+ map { s/-.*//; $_ }
+ grep { /^\d+-plan$/ } readdir $dir;
+
+ closedir $dir;
+}
+
+plan 'tests' => 5 * scalar @tests;
+
+for my $test ( @tests ) {
+
+ print STDERR 'Working on test ' . $test . "\n" if $ENV{'DEBUG_TESTS'};
+
+ my $plan_file = 't/17-as_text/' . $test . '-plan';
+
+ my $explain = Pg::Explain->new( 'source_file' => $plan_file );
+ isa_ok( $explain, 'Pg::Explain' );
+ isa_ok( $explain->top_node, 'Pg::Explain::Node' );
+
+ my $textual = $explain->as_text();
+
+ my $reparsed = Pg::Explain->new( 'source' => $textual );
+ isa_ok( $reparsed, 'Pg::Explain' );
+ isa_ok( $reparsed->top_node, 'Pg::Explain::Node' );
+
+ my $expected = $explain->top_node->get_struct();
+ my $got = $reparsed->top_node->get_struct();
+
+ print STDERR Dumper($got) if $ENV{'DEBUG_TESTS'};
+
+ cmp_deeply( $got, $expected, 'Plan no. ' . $test . ' passed as file.', );
+}
+
+exit;
View
1  t/17-as_text/01-plan
@@ -0,0 +1 @@
+Seq Scan on tenk1 (cost=0.00..333.00 rows=10000 width=148)
View
1  t/17-as_text/02-plan
@@ -0,0 +1 @@
+Seq Scan on test (cost=0.00..34.00 rows=2400 width=4) (actual time=0.052..2.183 rows=1000 loops=1)
View
1  t/17-as_text/03-plan
@@ -0,0 +1 @@
+Seq Scan on test x (cost=0.00..14.00 rows=1000 width=4) (actual time=0.025..1.985 rows=1000 loops=1)
View
2  t/17-as_text/04-plan
@@ -0,0 +1,2 @@
+ Index Scan using test_pkey on test (cost=0.00..8.27 rows=1 width=4)
+ Index Cond: (id = 4)
View
2  t/17-as_text/05-plan
@@ -0,0 +1,2 @@
+ Index Scan using test_pkey on test t (cost=0.00..8.27 rows=1 width=4) (actual time=0.029..0.033 rows=1 loops=1)
+ Index Cond: (id = 1)
View
7 t/17-as_text/06-plan
@@ -0,0 +1,7 @@
+# explain analyze select * from test as t where id = 1;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------
+ Index Scan using test_pkey on test t (cost=0.00..8.27 rows=1 width=4) (actual time=0.029..0.033 rows=1 loops=1)
+ Index Cond: (id = 1)
+ Total runtime: 0.083 ms
+(3 rows)
View
5 t/17-as_text/07-plan
@@ -0,0 +1,5 @@
+# explain select 1;
+ QUERY PLAN
+------------------------------------------
+ Result (cost=0.00..0.01 rows=1 width=0)
+(1 row)
View
6 t/17-as_text/08-plan
@@ -0,0 +1,6 @@
+# explain select * from test limit 1;
+ QUERY PLAN
+--------------------------------------------------------------
+ Limit (cost=0.00..0.01 rows=1 width=4)
+ -> Seq Scan on test (cost=0.00..14.00 rows=1000 width=4)
+(2 rows)
View
9 t/17-as_text/09-plan
@@ -0,0 +1,9 @@
+# explain select * from test t1 join test t2 on t1.id = t2.id + 1 limit 1;
+ QUERY PLAN
+-------------------------------------------------------------------------------------
+ Limit (cost=0.00..0.34 rows=1 width=8)
+ -> Nested Loop (cost=0.00..335.20 rows=1000 width=8)
+ -> Seq Scan on test t2 (cost=0.00..14.00 rows=1000 width=4)
+ -> Index Scan using test_pkey on test t1 (cost=0.00..0.31 rows=1 width=4)
+ Index Cond: (t1.id = (t2.id + 1))
+(5 rows)
View
14 t/17-as_text/10-plan
@@ -0,0 +1,14 @@
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+ Limit (cost=18602.75..19244.22 rows=1 width=636) (actual time=126.516..126.517 rows=1 loops=1)
+ -> Nested Loop (cost=0.00..2254139.98 rows=3514 width=636) (actual time=2.637..126.488 rows=30 loops=1)
+ -> Nested Loop (cost=0.00..1860597.05 rows=73883 width=640) (actual time=0.214..121.234 rows=588 loops=1)
+ -> Index Scan Backward using index_stories_on_published_at on stories (cost=0.00..405621.70 rows=1303286 width=636) (actual time=0.099..52.447 rows=10157 loops=1)
+ Filter: (NOT hidden)
+ -> Index Scan using index_story_tag_attachments_on_story_id_and_story_tag_id on story_tag_attachments (cost=0.00..1.10 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=10157)
+ Index Cond: ((story_tag_attachments.story_id = stories.id) AND (story_tag_attachments.story_tag_id = 166))
+ -> Index Scan using index_story_region_attachments_on_story_id_and_region_id on story_region_attachments (cost=0.00..5.31 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=588)
+ Index Cond: ((story_region_attachments.story_id = stories.id) AND (story_region_attachments.region_id = 26824))
+ Total runtime: 126.625 ms
+(10 rows)
+
View
8 t/17-as_text/11-plan
@@ -0,0 +1,8 @@
+# explain analyze select 1 = (select 1);
+ QUERY PLAN
+--------------------------------------------------------------------------------------------
+ Result (cost=0.01..0.02 rows=1 width=0) (actual time=0.033..0.035 rows=1 loops=1)
+ InitPlan
+ -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.003..0.005 rows=1 loops=1)
+ Total runtime: 0.234 ms
+(4 rows)
View
8 t/17-as_text/12-plan
@@ -0,0 +1,8 @@
+# explain select *, (select oid::int4 from pg_class c2 where c2.relname = c.relname) - oid::int4 from pg_class c;
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------
+ Seq Scan on pg_class c (cost=0.00..1885.60 rows=227 width=200)
+ SubPlan
+ -> Index Scan using pg_class_relname_nsp_index on pg_class c2 (cost=0.00..8.27 rows=1 width=4)
+ Index Cond: (relname = $0)
+(4 rows)
View
12 t/17-as_text/13-plan
@@ -0,0 +1,12 @@
+# explain analyze select *, (select 1) + (select oid::int4 from pg_class c2 where c2.relname = c.relname) - oid::int4 from pg_class c;
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------
+ Seq Scan on pg_class c (cost=0.00..1490.37 rows=226 width=200) (actual time=0.092..11.416 rows=226 loops=1)
+ InitPlan
+ -> Result (cost=0.00..0.00 rows=1 width=0) (actual time=0.002..0.004 rows=1 loops=1)
+ SubPlan
+ -> Seq Scan on pg_class c2 (cost=0.00..6.57 rows=1 width=4) (actual time=0.022..0.043 rows=1 loops=226)
+ Filter: (relname = $1)
+ Total runtime: 11.804 ms
+(7 rows)
+
View
36 t/17-as_text/14-plan
@@ -0,0 +1,36 @@
+# - plan copied from http://explain-analyze.info/ - only for testing purposes
+
+ Limit (cost=186.82..186.82 rows=1 width=359) (actual time=1352.355..1352.405 rows=50 loops=1)
+ -> Sort (cost=186.82..186.82 rows=1 width=359) (actual time=1352.354..1352.373 rows=50 loops=1)
+ Sort Key: s.last_updated_date
+ Sort Method: top-N heapsort Memory: 50kB
+ -> Nested Loop Left Join (cost=2.16..186.81 rows=1 width=359) (actual time=0.733..1271.399 rows=13988 loops=1)
+ -> Nested Loop Left Join (cost=2.16..186.49 rows=1 width=351) (actual time=0.706..1116.630 rows=13988 loops=1)
+ Filter: ((mu.mls_id IS NULL) OR (mu.mls_update_id = (subplan)))
+ -> Nested Loop (cost=2.16..19.03 rows=1 width=321) (actual time=0.676..204.019 rows=13988 loops=1)
+ Join Filter: _st_contains(poly_inter_1.the_geom, s.centroid)
+ -> Subquery Scan poly_inter_1 (cost=2.16..2.44 rows=1 width=32) (actual time=0.520..0.531 rows=1 loops=1)
+ Filter: (st_geometrytype(poly_inter_1.the_geom) ~~* '%polygon%'::text)
+ -> Result (cost=2.16..2.18 rows=1 width=0) (actual time=0.433..0.441 rows=1 loops=1)
+ InitPlan
+ -> Seq Scan on markets (cost=0.00..2.15 rows=1 width=32) (actual time=0.015..0.020 rows=1 loops=1)
+ Filter: ((name)::text = 'seattle'::text)
+ -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.048..0.050 rows=1 loops=1)
+ -> Index Scan using listing_search_keys_centroid on listing_search_keys s (cost=0.00..16.58 rows=1 width=421) (actual time=0.131..139.571 rows=13988 loops=1)
+ Index Cond: (poly_inter_1.the_geom && s.centroid)
+ Filter: ((NOT s.is_townhome) AND (s.property_type_id = ANY ('{3,6}'::bigint[])) AND (s.access_level <= 3) AND (s.listing_type_id = ANY ('{1,2,3}'::integer[])) AND (0 <> (s.search_status_id & 1)) AND (s.last_updated_date >= (('now'::text)::date - '7 days'::interval)))
+ -> Index Scan using mls_updates_listing_id_and_field on mls_updates mu (cost=0.00..4.19 rows=7 width=55) (actual time=0.010..0.012 rows=2 loops=13988)
+ Index Cond: (mu.listing_id = s.listing_id)
+ Filter: (((mu.mls_column_updated)::text <> 'search_status_id'::text) OR (((mu.mls_column_old_value)::text <> '32'::text) AND ((mu.mls_column_new_value)::text <> '32'::text)))
+ SubPlan
+ -> Limit (cost=23.31..23.31 rows=1 width=16) (actual time=0.030..0.031 rows=1 loops=22035)
+ -> Sort (cost=23.31..23.32 rows=7 width=16) (actual time=0.029..0.029 rows=1 loops=22035)
+ Sort Key: mu2.update_date
+ Sort Method: quicksort Memory: 25kB
+ -> Index Scan using mls_updates_listing_id_and_field on mls_updates mu2 (cost=0.00..23.27 rows=7 width=16) (actual time=0.005..0.019 rows=12 loops=22035)
+ Index Cond: (listing_id = $0)
+ Filter: (((mls_column_updated)::text <> 'search_status_id'::text) OR (((mls_column_old_value)::text <> '32'::text) AND ((mls_column_new_value)::text <> '32'::text)))
+ -> Index Scan using markets_pkey on markets m (cost=0.00..0.27 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=13988)
+ Index Cond: (s.primary_market_id = m.market_id)
+ Total runtime: 1352.834 ms
+(33 rows)
View
5 t/17-as_text/15-plan
@@ -0,0 +1,5 @@
+Hash Join (cost=6.65..104.10 rows=1600 width=1363) (actual time=0.002..0.002 rows=0 loops=1)
+ Hash Cond: ("outer".uzytkownik_id = "inner".id)
+ -> Seq Scan on uprawnienie_uzytkownik uu (cost=0.00..26.00 rows=1600 width=17) (actual time=0.001..0.001 rows=0 loops=1)
+ -> Hash (cost=6.12..6.12 rows=212 width=1346) (never executed)
+ -> Seq Scan on uprawnienie u (cost=0.00..6.12 rows=212 width=1346) (never executed)
View
5 t/17-as_text/16-plan
@@ -0,0 +1,5 @@
+ Bitmap Heap Scan on poi (cost=39.88..3946.78 rows=1113 width=323)
+ Recheck Cond: ((poi_id >= 100) AND (poi_id <= 3000))
+ -> Bitmap Index Scan on poi_pkey (cost=0.00..39.60 rows=1113 width=0)
+ Index Cond: ((poi_id >= 100) AND (poi_id <= 3000))
+
View
2  t/17-as_text/17-plan
@@ -0,0 +1,2 @@
+ Limit (cost=0.00..0.08 rows=2 width=36)
+ -> Index Scan Backward using w on x (cost=0.00..5770.49 rows=149976 width=36)
View
15 t/17-as_text/18-plan
@@ -0,0 +1,15 @@
+ -> Index Scan using id_contact_event_idx on of_contact_event e (cost=30.00..34.33 rows=1 width=40) (actual time=0.003..0.003 rows=1 loops=19499)
+ Index Cond: (e.id_contact_event = CASE WHEN (("outer".client_status_cc = 2) AND ("outer".client_status_unit = 2) AND ("outer".id_employee_responsible IS NULL) AND ("outer".id_unit_responsible IS NULL)) THEN (subplan) ELSE "outer".latest_event END)
+ SubPlan
+ -> Limit (cost=29.99..30.00 rows=1 width=19) (actual time=0.018..0.018 rows=1 loops=5570)
+ -> Sort (cost=29.99..30.00 rows=4 width=19) (actual time=0.018..0.018 rows=1 loops=5570)
+ Sort Key: status, date_registration, visit
+ -> Index Scan using idx_of_contact_event_id_contact_client on of_contact_event ev2 (cost=0.00..29.95 rows=4 width=19) (actual time=0.006..0.012 rows=6 loops=5570)
+ Index Cond: (id_contact_client = $0)
+ Filter: (id_contact_event < $1)
+ -> Limit (cost=29.99..30.00 rows=1 width=19) (never executed)
+ -> Sort (cost=29.99..30.00 rows=4 width=19) (never executed)
+ Sort Key: status, date_registration, visit
+ -> Index Scan using idx_of_contact_event_id_contact_client on of_contact_event ev2 (cost=0.00..29.95 rows=4 width=19) (never executed)
+ Index Cond: (id_contact_client = $0)
+ Filter: (id_contact_event < $1)
View
42 t/17-as_text/19-plan
@@ -0,0 +1,42 @@
+
+Sort (cost=19735.07..19735.08 rows=1 width=108) (actual time=984.815..984.898 rows=705 loops=1)
+ Sort Key: gp.idx_gabinetu, (COALESCE(z.godz_otwarcia, gp.godz_otwarcia))
+ Sort Method: quicksort Memory: 124kB
+ -> Nested Loop Left Join (cost=14296.97..19735.06 rows=1 width=108) (actual time=625.283..983.437 rows=705 loops=1)
+ Join Filter: (($1 + s.s) <= COALESCE(gu.data_do, '3000-01-01'::date))
+ Filter: (((CASE WHEN (z.idx_gdz_pracy IS NULL) THEN gp.czy_ukryty ELSE z.czy_ukryty END)::"char" = 'N'::"char") OR ps_chkupr(246) OR (NOT (gu.idx_pracownika IS NULL)))
+ -> Hash Left Join (cost=14296.72..19733.98 rows=1 width=114) (actual time=624.938..960.508 rows=705 loops=1)
+ Hash Cond: ((gp.idx_gdz_pracy = z.idx_gdz_pracy_wyjsciowy) AND (($1 + s.s) = z.wazny_od))
+ Filter: ((((CASE WHEN (z.idx_gdz_pracy IS NULL) THEN gp.czy_lokalny ELSE z.czy_lokalny END)::"char" = 'N'::"char") OR (g.idx_placowki = ps_akt_placowka())) AND ((SubPlan 1) = $5))
+ -> Merge Join (cost=3509.52..3900.07 rows=1192 width=74) (actual time=490.880..654.251 rows=14703 loops=1)
+ Merge Cond: ((date_part('dow'::text, (($1 + s.s))::timestamp without time zone)) = ((gp.dzien_tygodnia)::double precision))
+ Join Filter: ((($1 + s.s) >= gp.wazny_od) AND (($1 + s.s) <= gp.wazny_do))
+ -> Sort (cost=64.83..67.33 rows=1000 width=4) (actual time=0.056..0.059 rows=11 loops=1)
+ Sort Key: (date_part('dow'::text, (($1 + s.s))::timestamp without time zone))
+ Sort Method: quicksort Memory: 25kB
+ -> Function Scan on generate_series s (cost=0.00..15.00 rows=1000 width=4) (actual time=0.032..0.041 rows=11 loops=1)
+ -> Sort (cost=3444.69..3450.06 rows=2146 width=70) (actual time=490.804..561.202 rows=173693 loops=1)
+ Sort Key: ((gp.dzien_tygodnia)::double precision)
+ Sort Method: external sort Disk: 11312kB
+ -> Nested Loop (cost=46.42..3325.94 rows=2146 width=70) (actual time=0.461..198.491 rows=113394 loops=1)
+ -> Hash Join (cost=46.42..129.38 rows=19 width=12) (actual time=0.437..3.798 rows=1252 loops=1)
+ Hash Cond: (g.idx_placowki = p.idx_placowki)
+ -> Seq Scan on s_gabinety g (cost=0.00..82.63 rows=38 width=8) (actual time=0.009..1.747 rows=2443 loops=1)
+ Filter: ((idx_placowki = $3) OR ($3 = 0))
+ -> Hash (cost=46.19..46.19 rows=19 width=4) (actual time=0.416..0.416 rows=134 loops=1)
+ -> Seq Scan on s_lokalizacje_placowki p (cost=0.00..46.19 rows=19 width=4) (actual time=0.008..0.342 rows=134 loops=1)
+ Filter: ((idx_lokalizacji = $5) OR ($5 = 0))
+ -> Index Scan using s_gabinety_godziny_pracy_idx on s_gabinety_godziny_pracy gp (cost=0.00..166.83 rows=113 width=62) (actual time=0.007..0.107 rows=91 loops=1252)
+ Index Cond: (gp.idx_gabinetu = g.idx_gabinetu)
+ Filter: (gp.idx_gdz_pracy_wyjsciowy IS NULL)
+ -> Hash (cost=5637.28..5637.28 rows=207928 width=50) (actual time=122.250..122.250 rows=2778 loops=1)
+ -> Seq Scan on s_gabinety_godziny_pracy z (cost=0.00..5637.28 rows=207928 width=50) (actual time=0.014..94.524 rows=207931 loops=1)
+ SubPlan 1
+ -> Aggregate (cost=36.21..36.22 rows=1 width=0) (actual time=0.005..0.005 rows=1 loops=11341)
+ -> Bitmap Heap Scan on s_gabinety_godziny_pracy_uslugi gpu (cost=33.18..36.21 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=11341)
+ Recheck Cond: ((idx_gdz_pracy = COALESCE($0, $1)) AND (idx_wariantu_suslugi = ANY ($4)))
+ -> Bitmap Index Scan on s_gabinety_godziny_pracy_uslugi_pkey (cost=0.00..33.18 rows=1 width=0) (actual time=0.003..0.003 rows=0 loops=11341)
+ Index Cond: ((idx_gdz_pracy = COALESCE($0, $1)) AND (idx_wariantu_suslugi = ANY ($4)))
+ -> Index Scan using s_lokalizacje_placowki_upr_graf_ukr_pkey on s_lokalizacje_placowki_upr_graf_ukr gu (cost=0.25..0.81 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=705)
+ Index Cond: ((gu.idx_placowki = p.idx_placowki) AND (gu.idx_pracownika = ps_akt_user()) AND (($1 + s.s) >= gu.data_od))
+Total runtime: 987.935 ms
View
2  t/17-as_text/20-plan
@@ -0,0 +1,2 @@
+"Limit (cost=0.00..0.08 rows=2 width=190) (actual time=0.033..0.043 rows=2 loops=1)"
+" -> Seq Scan on pg_class (cost=0.00..13.61 rows=361 width=190) (actual time=0.028..0.030 rows=2 loops=1)"
View
11 t/17-as_text/21-plan
@@ -0,0 +1,11 @@
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------------------------------------------------------
+ Index Scan using pg_class_oid_index on pg_class (cost=0.17..8.44 rows=1 width=194) (actual time=0.035..0.036 rows=1 loops=1)
+ Index Cond: (oid = $1)
+ InitPlan 2 (returns $1)
+ -> Result (cost=0.16..0.17 rows=1 width=0) (actual time=0.023..0.023 rows=1 loops=1)
+ InitPlan 1 (returns $0)
+ -> Limit (cost=0.00..0.16 rows=1 width=4) (actual time=0.020..0.021 rows=1 loops=1)
+ -> Index Scan using pg_class_oid_index on pg_class (cost=0.00..44.47 rows=281 width=4) (actual time=0.019..0.019 rows=1 loops=1)
+ Index Cond: (oid IS NOT NULL)
+ Total runtime: 0.081 ms
View
6 t/17-as_text/22-plan
@@ -0,0 +1,6 @@
+"GroupAggregate (cost=265935.63..285867.54 rows=137462 width=26)"
+" Filter: (count(*) > 1)"
+" -> Sort (cost=265935.63..269372.16 rows=1374614 width=26)"
+" Sort Key: latitude_decimal, longitude_decimal"
+" -> Seq Scan on temp_city (cost=0.00..27121.14 rows=1374614 width=26)"
+
View
12 t/17-as_text/23-plan
@@ -0,0 +1,12 @@
+'Sort (cost=454214.22..454299.03 rows=33927 width=49) (actual time=102348.421..102386.840 rows=24935 loops=1)'
+' Sort Key: ak.artikelnr_list'
+' Sort Method: quicksort Memory: 3536kB'
+' -> Nested Loop (cost=0.00..451661.19 rows=33927 width=49) (actual time=8.244..101961.451 rows=24935 loops=1)'
+' Join Filter: ((aas.artikelnrforvererbung)::text = ANY ((ARRAY[ak.keysum1, ak.keysum2, ak.keysum3, ak.keysum4, ak.keysum5, ak.keysum6])::text[]))'
+' -> Seq Scan on t_artikelkey ak (cost=0.00..2312.30 rows=25130 width=237) (actual time=0.018..177.510 rows=25112 loops=1)'
+' -> Materialize (cost=0.00..26.72 rows=894 width=10) (actual time=0.002..1.322 rows=894 loops=25112)'
+' -> Seq Scan on artikel_as aas (cost=0.00..22.25 rows=894 width=10) (actual time=0.026..2.017 rows=894 loops=1)'
+' Filter: ((aas_ask)::text = 'PRE'::text)'
+'Total runtime: 102423.136 ms'
+
+
View
12 t/17-as_text/24-plan
@@ -0,0 +1,12 @@
+'Sort (cost=148927.96..149012.78 rows=33927 width=49) (actual time=2906.084..2946.819 rows=24935 loops=1)'
+' Sort Key: ak.artikelnr_list'
+' Sort Method: quicksort Memory: 3536kB'
+' -> Nested Loop (cost=1.55..146374.93 rows=33927 width=49) (actual time=0.160..2531.059 rows=24935 loops=1)'
+' -> Seq Scan on t_artikelkey ak (cost=0.00..2312.30 rows=25130 width=237) (actual time=0.014..85.614 rows=25112 loops=1)'
+' -> Bitmap Heap Scan on artikel_as aas (cost=1.55..5.63 rows=6 width=10) (actual time=0.073..0.074 rows=1 loops=25112)'
+' Recheck Cond: ((aas.artikelnrforvererbung)::text = ANY ((ARRAY[ak.keysum1, ak.keysum2, ak.keysum3, ak.keysum4, ak.keysum5, ak.keysum6])::text[]))'
+' Filter: ((aas.aas_ask)::text = 'PRE'::text)'
+' -> Bitmap Index Scan on idx_artikel_as_artnrver (cost=0.00..1.55 rows=6 width=0) (actual time=0.066..0.066 rows=1 loops=25112)'
+' Index Cond: ((aas.artikelnrforvererbung)::text = ANY ((ARRAY[ak.keysum1, ak.keysum2, ak.keysum3, ak.keysum4, ak.keysum5, ak.keysum6])::text[]))'
+
+
View
13 t/17-as_text/25-plan
@@ -0,0 +1,13 @@
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------
+ Result (cost=0.02..0.06 rows=2 width=4) (actual time=0.006..0.009 rows=2 loops=1)
+ CTE cte_1
+ -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=1)
+ CTE cte_2
+ -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.001 rows=1 loops=1)
+ -> Append (cost=0.00..0.04 rows=2 width=4) (actual time=0.005..0.008 rows=2 loops=1)
+ -> CTE Scan on cte_1 (cost=0.00..0.02 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1)
+ -> CTE Scan on cte_2 (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1)
+ Total runtime: 0.080 ms
+(9 rows)
+
View
13 t/17-as_text/26-plan
@@ -0,0 +1,13 @@
+ QUERY PLAN
+-----------------------------------------------------------------------------------------------------------
+ Result (cost=0.02..0.06 rows=2 width=4) (actual time=0.006..0.009 rows=2 loops=1)
+ CTE cte_1
+ -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.000 rows=1 loops=1)
+ CTE cte_2
+ -> Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.000..0.001 rows=1 loops=1)
+ -> Append (cost=0.00..0.04 rows=2 width=4) (actual time=0.005..0.008 rows=2 loops=1)
+ -> CTE Scan on cte_1 a (cost=0.00..0.02 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=1)
+ -> CTE Scan on cte_2 b (cost=0.00..0.02 rows=1 width=4) (actual time=0.001..0.002 rows=1 loops=1)
+ Total runtime: 0.080 ms
+(9 rows)
+
Please sign in to comment.
Something went wrong with that request. Please try again.