mirror of
https://github.com/postgres/postgres.git
synced 2025-06-08 22:02:03 +03:00
Revert "Show index search count in EXPLAIN ANALYZE."
This reverts commit 5ead85fbc81162ab1594f656b036a22e814f96b3. This commit shows test failures with debug_parallel_query=regress. The underlying issue needs to be debugged, so revert for now.
This commit is contained in:
parent
4603903d29
commit
d00107cd63
@ -116,7 +116,6 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
|
|||||||
bas = GetAccessStrategy(BAS_BULKREAD);
|
bas = GetAccessStrategy(BAS_BULKREAD);
|
||||||
npages = RelationGetNumberOfBlocks(scan->indexRelation);
|
npages = RelationGetNumberOfBlocks(scan->indexRelation);
|
||||||
pgstat_count_index_scan(scan->indexRelation);
|
pgstat_count_index_scan(scan->indexRelation);
|
||||||
scan->nsearches++;
|
|
||||||
|
|
||||||
for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
|
for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
|
||||||
{
|
{
|
||||||
|
@ -173,11 +173,10 @@ CREATE INDEX
|
|||||||
Buffers: shared hit=21864
|
Buffers: shared hit=21864
|
||||||
-> Bitmap Index Scan on bloomidx (cost=0.00..178436.00 rows=1 width=0) (actual time=20.005..20.005 rows=2300.00 loops=1)
|
-> Bitmap Index Scan on bloomidx (cost=0.00..178436.00 rows=1 width=0) (actual time=20.005..20.005 rows=2300.00 loops=1)
|
||||||
Index Cond: ((i2 = 898732) AND (i5 = 123451))
|
Index Cond: ((i2 = 898732) AND (i5 = 123451))
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=19608
|
Buffers: shared hit=19608
|
||||||
Planning Time: 0.099 ms
|
Planning Time: 0.099 ms
|
||||||
Execution Time: 22.632 ms
|
Execution Time: 22.632 ms
|
||||||
(11 rows)
|
(10 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -209,15 +208,13 @@ CREATE INDEX
|
|||||||
Buffers: shared hit=6
|
Buffers: shared hit=6
|
||||||
-> Bitmap Index Scan on btreeidx5 (cost=0.00..4.52 rows=11 width=0) (actual time=0.026..0.026 rows=7.00 loops=1)
|
-> Bitmap Index Scan on btreeidx5 (cost=0.00..4.52 rows=11 width=0) (actual time=0.026..0.026 rows=7.00 loops=1)
|
||||||
Index Cond: (i5 = 123451)
|
Index Cond: (i5 = 123451)
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=3
|
Buffers: shared hit=3
|
||||||
-> Bitmap Index Scan on btreeidx2 (cost=0.00..4.52 rows=11 width=0) (actual time=0.007..0.007 rows=8.00 loops=1)
|
-> Bitmap Index Scan on btreeidx2 (cost=0.00..4.52 rows=11 width=0) (actual time=0.007..0.007 rows=8.00 loops=1)
|
||||||
Index Cond: (i2 = 898732)
|
Index Cond: (i2 = 898732)
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=3
|
Buffers: shared hit=3
|
||||||
Planning Time: 0.264 ms
|
Planning Time: 0.264 ms
|
||||||
Execution Time: 0.047 ms
|
Execution Time: 0.047 ms
|
||||||
(15 rows)
|
(13 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
Although this query runs much faster than with either of the single
|
Although this query runs much faster than with either of the single
|
||||||
indexes, we pay a penalty in index size. Each of the single-column
|
indexes, we pay a penalty in index size. Each of the single-column
|
||||||
|
@ -4234,32 +4234,16 @@ description | Waiting for a newly initialized WAL file to reach durable storage
|
|||||||
|
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
Index scans may sometimes perform multiple index searches per execution.
|
Queries that use certain <acronym>SQL</acronym> constructs to search for
|
||||||
Each index search increments <structname>pg_stat_all_indexes</structname>.<structfield>idx_scan</structfield>,
|
rows matching any value out of a list or array of multiple scalar values
|
||||||
|
(see <xref linkend="functions-comparisons"/>) perform multiple
|
||||||
|
<quote>primitive</quote> index scans (up to one primitive scan per scalar
|
||||||
|
value) during query execution. Each internal primitive index scan
|
||||||
|
increments <structname>pg_stat_all_indexes</structname>.<structfield>idx_scan</structfield>,
|
||||||
so it's possible for the count of index scans to significantly exceed the
|
so it's possible for the count of index scans to significantly exceed the
|
||||||
total number of index scan executor node executions.
|
total number of index scan executor node executions.
|
||||||
</para>
|
</para>
|
||||||
<para>
|
|
||||||
This can happen with queries that use certain <acronym>SQL</acronym>
|
|
||||||
constructs to search for rows matching any value out of a list or array of
|
|
||||||
multiple scalar values (see <xref linkend="functions-comparisons"/>). It
|
|
||||||
can also happen to queries with a
|
|
||||||
<literal><replaceable>column_name</replaceable> =
|
|
||||||
<replaceable>value1</replaceable> OR
|
|
||||||
<replaceable>column_name</replaceable> =
|
|
||||||
<replaceable>value2</replaceable> ...</literal> construct, though only
|
|
||||||
when the optimizer transforms the construct into an equivalent
|
|
||||||
multi-valued array representation.
|
|
||||||
</para>
|
|
||||||
</note>
|
</note>
|
||||||
<tip>
|
|
||||||
<para>
|
|
||||||
<command>EXPLAIN ANALYZE</command> outputs the total number of index
|
|
||||||
searches performed by each index scan node. See
|
|
||||||
<xref linkend="using-explain-analyze"/> for an example demonstrating how
|
|
||||||
this works.
|
|
||||||
</para>
|
|
||||||
</tip>
|
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
|
@ -729,11 +729,9 @@ WHERE t1.unique1 < 10 AND t1.unique2 = t2.unique2;
|
|||||||
Buffers: shared hit=3 read=5 written=4
|
Buffers: shared hit=3 read=5 written=4
|
||||||
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..4.36 rows=10 width=0) (actual time=0.004..0.004 rows=10.00 loops=1)
|
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..4.36 rows=10 width=0) (actual time=0.004..0.004 rows=10.00 loops=1)
|
||||||
Index Cond: (unique1 < 10)
|
Index Cond: (unique1 < 10)
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=2
|
Buffers: shared hit=2
|
||||||
-> Index Scan using tenk2_unique2 on tenk2 t2 (cost=0.29..7.90 rows=1 width=244) (actual time=0.003..0.003 rows=1 loops=10)
|
-> Index Scan using tenk2_unique2 on tenk2 t2 (cost=0.29..7.90 rows=1 width=244) (actual time=0.003..0.003 rows=1 loops=10)
|
||||||
Index Cond: (unique2 = t1.unique2)
|
Index Cond: (unique2 = t1.unique2)
|
||||||
Index Searches: 10
|
|
||||||
Buffers: shared hit=24 read=6
|
Buffers: shared hit=24 read=6
|
||||||
Planning:
|
Planning:
|
||||||
Buffers: shared hit=15 dirtied=9
|
Buffers: shared hit=15 dirtied=9
|
||||||
@ -792,7 +790,6 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;
|
|||||||
Buffers: shared hit=92
|
Buffers: shared hit=92
|
||||||
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=100 width=0) (actual time=0.013..0.013 rows=100.00 loops=1)
|
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=100 width=0) (actual time=0.013..0.013 rows=100.00 loops=1)
|
||||||
Index Cond: (unique1 < 100)
|
Index Cond: (unique1 < 100)
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=2
|
Buffers: shared hit=2
|
||||||
Planning:
|
Planning:
|
||||||
Buffers: shared hit=12
|
Buffers: shared hit=12
|
||||||
@ -808,58 +805,6 @@ WHERE t1.unique1 < 100 AND t1.unique2 = t2.unique2 ORDER BY t1.fivethous;
|
|||||||
shown.)
|
shown.)
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
|
||||||
Index Scan nodes (as well as Bitmap Index Scan and Index-Only Scan nodes)
|
|
||||||
show an <quote>Index Searches</quote> line that reports the total number
|
|
||||||
of searches across <emphasis>all</emphasis> node
|
|
||||||
executions/<literal>loops</literal>:
|
|
||||||
|
|
||||||
<screen>
|
|
||||||
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE thousand IN (1, 500, 700, 999);
|
|
||||||
QUERY PLAN
|
|
||||||
-------------------------------------------------------------------&zwsp;---------------------------------------------------------
|
|
||||||
Bitmap Heap Scan on tenk1 (cost=9.45..73.44 rows=40 width=244) (actual time=0.012..0.028 rows=40.00 loops=1)
|
|
||||||
Recheck Cond: (thousand = ANY ('{1,500,700,999}'::integer[]))
|
|
||||||
Heap Blocks: exact=39
|
|
||||||
Buffers: shared hit=47
|
|
||||||
-> Bitmap Index Scan on tenk1_thous_tenthous (cost=0.00..9.44 rows=40 width=0) (actual time=0.009..0.009 rows=40.00 loops=1)
|
|
||||||
Index Cond: (thousand = ANY ('{1,500,700,999}'::integer[]))
|
|
||||||
Index Searches: 4
|
|
||||||
Buffers: shared hit=8
|
|
||||||
Planning Time: 0.037 ms
|
|
||||||
Execution Time: 0.034 ms
|
|
||||||
</screen>
|
|
||||||
|
|
||||||
Here we see a Bitmap Index Scan node that needed 4 separate index
|
|
||||||
searches. The scan had to search the index from the
|
|
||||||
<structname>tenk1_thous_tenthous</structname> index root page once per
|
|
||||||
<type>integer</type> value from the predicate's <literal>IN</literal>
|
|
||||||
construct. However, the number of index searches often won't have such a
|
|
||||||
simple correspondence to the query predicate:
|
|
||||||
|
|
||||||
<screen>
|
|
||||||
EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE thousand IN (1, 2, 3, 4);
|
|
||||||
QUERY PLAN
|
|
||||||
----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
Bitmap Heap Scan on tenk1 (cost=9.45..73.44 rows=40 width=244) (actual time=0.009..0.019 rows=40.00 loops=1)
|
|
||||||
Recheck Cond: (thousand = ANY ('{1,2,3,4}'::integer[]))
|
|
||||||
Heap Blocks: exact=38
|
|
||||||
Buffers: shared hit=40
|
|
||||||
-> Bitmap Index Scan on tenk1_thous_tenthous (cost=0.00..9.44 rows=40 width=0) (actual time=0.005..0.005 rows=40.00 loops=1)
|
|
||||||
Index Cond: (thousand = ANY ('{1,2,3,4}'::integer[]))
|
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=2
|
|
||||||
Planning Time: 0.029 ms
|
|
||||||
Execution Time: 0.026 ms
|
|
||||||
</screen>
|
|
||||||
|
|
||||||
This variant of our <literal>IN</literal> query performed only 1 index
|
|
||||||
search. It spent less time traversing the index (compared to the original
|
|
||||||
query) because its <literal>IN</literal> construct uses values matching
|
|
||||||
index tuples stored next to each other, on the same
|
|
||||||
<structname>tenk1_thous_tenthous</structname> index leaf page.
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Another type of extra information is the number of rows removed by a
|
Another type of extra information is the number of rows removed by a
|
||||||
filter condition:
|
filter condition:
|
||||||
@ -916,7 +861,6 @@ EXPLAIN ANALYZE SELECT * FROM polygon_tbl WHERE f1 @> polygon '(0.5,2.0)';
|
|||||||
Index Scan using gpolygonind on polygon_tbl (cost=0.13..8.15 rows=1 width=85) (actual time=0.074..0.074 rows=0.00 loops=1)
|
Index Scan using gpolygonind on polygon_tbl (cost=0.13..8.15 rows=1 width=85) (actual time=0.074..0.074 rows=0.00 loops=1)
|
||||||
Index Cond: (f1 @> '((0.5,2))'::polygon)
|
Index Cond: (f1 @> '((0.5,2))'::polygon)
|
||||||
Rows Removed by Index Recheck: 1
|
Rows Removed by Index Recheck: 1
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=1
|
Buffers: shared hit=1
|
||||||
Planning Time: 0.039 ms
|
Planning Time: 0.039 ms
|
||||||
Execution Time: 0.098 ms
|
Execution Time: 0.098 ms
|
||||||
@ -950,10 +894,8 @@ EXPLAIN (ANALYZE, BUFFERS OFF) SELECT * FROM tenk1 WHERE unique1 < 100 AND un
|
|||||||
-> BitmapAnd (cost=25.07..25.07 rows=10 width=0) (actual time=0.100..0.101 rows=0.00 loops=1)
|
-> BitmapAnd (cost=25.07..25.07 rows=10 width=0) (actual time=0.100..0.101 rows=0.00 loops=1)
|
||||||
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=100 width=0) (actual time=0.027..0.027 rows=100.00 loops=1)
|
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=100 width=0) (actual time=0.027..0.027 rows=100.00 loops=1)
|
||||||
Index Cond: (unique1 < 100)
|
Index Cond: (unique1 < 100)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Index Scan on tenk1_unique2 (cost=0.00..19.78 rows=999 width=0) (actual time=0.070..0.070 rows=999.00 loops=1)
|
-> Bitmap Index Scan on tenk1_unique2 (cost=0.00..19.78 rows=999 width=0) (actual time=0.070..0.070 rows=999.00 loops=1)
|
||||||
Index Cond: (unique2 > 9000)
|
Index Cond: (unique2 > 9000)
|
||||||
Index Searches: 1
|
|
||||||
Planning Time: 0.162 ms
|
Planning Time: 0.162 ms
|
||||||
Execution Time: 0.143 ms
|
Execution Time: 0.143 ms
|
||||||
</screen>
|
</screen>
|
||||||
@ -981,7 +923,6 @@ EXPLAIN ANALYZE UPDATE tenk1 SET hundred = hundred + 1 WHERE unique1 < 100;
|
|||||||
Buffers: shared hit=4 read=2
|
Buffers: shared hit=4 read=2
|
||||||
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=100 width=0) (actual time=0.031..0.031 rows=100.00 loops=1)
|
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=100 width=0) (actual time=0.031..0.031 rows=100.00 loops=1)
|
||||||
Index Cond: (unique1 < 100)
|
Index Cond: (unique1 < 100)
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared read=2
|
Buffers: shared read=2
|
||||||
Planning Time: 0.151 ms
|
Planning Time: 0.151 ms
|
||||||
Execution Time: 1.856 ms
|
Execution Time: 1.856 ms
|
||||||
@ -1120,7 +1061,6 @@ EXPLAIN ANALYZE SELECT * FROM tenk1 WHERE unique1 < 100 AND unique2 > 9000
|
|||||||
Index Cond: (unique2 > 9000)
|
Index Cond: (unique2 > 9000)
|
||||||
Filter: (unique1 < 100)
|
Filter: (unique1 < 100)
|
||||||
Rows Removed by Filter: 287
|
Rows Removed by Filter: 287
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=16
|
Buffers: shared hit=16
|
||||||
Planning Time: 0.077 ms
|
Planning Time: 0.077 ms
|
||||||
Execution Time: 0.086 ms
|
Execution Time: 0.086 ms
|
||||||
|
@ -506,11 +506,10 @@ EXPLAIN ANALYZE EXECUTE query(100, 200);
|
|||||||
Buffers: shared hit=4
|
Buffers: shared hit=4
|
||||||
-> Index Scan using test_pkey on test (cost=0.29..10.27 rows=99 width=8) (actual time=0.009..0.025 rows=99.00 loops=1)
|
-> Index Scan using test_pkey on test (cost=0.29..10.27 rows=99 width=8) (actual time=0.009..0.025 rows=99.00 loops=1)
|
||||||
Index Cond: ((id > 100) AND (id < 200))
|
Index Cond: ((id > 100) AND (id < 200))
|
||||||
Index Searches: 1
|
|
||||||
Buffers: shared hit=4
|
Buffers: shared hit=4
|
||||||
Planning Time: 0.244 ms
|
Planning Time: 0.244 ms
|
||||||
Execution Time: 0.073 ms
|
Execution Time: 0.073 ms
|
||||||
(10 rows)
|
(9 rows)
|
||||||
</programlisting>
|
</programlisting>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
@ -1046,7 +1046,6 @@ SELECT count(*) FROM words WHERE word = 'caterpiler';
|
|||||||
-> Index Only Scan using wrd_word on wrd (cost=0.42..4.44 rows=1 width=0) (actual time=0.039..0.039 rows=0.00 loops=1)
|
-> Index Only Scan using wrd_word on wrd (cost=0.42..4.44 rows=1 width=0) (actual time=0.039..0.039 rows=0.00 loops=1)
|
||||||
Index Cond: (word = 'caterpiler'::text)
|
Index Cond: (word = 'caterpiler'::text)
|
||||||
Heap Fetches: 0
|
Heap Fetches: 0
|
||||||
Index Searches: 1
|
|
||||||
Planning time: 0.164 ms
|
Planning time: 0.164 ms
|
||||||
Execution time: 0.117 ms
|
Execution time: 0.117 ms
|
||||||
</programlisting>
|
</programlisting>
|
||||||
@ -1091,7 +1090,6 @@ SELECT word FROM words ORDER BY word <-> 'caterpiler' LIMIT 10;
|
|||||||
Limit (cost=0.29..1.06 rows=10 width=10) (actual time=187.222..188.257 rows=10.00 loops=1)
|
Limit (cost=0.29..1.06 rows=10 width=10) (actual time=187.222..188.257 rows=10.00 loops=1)
|
||||||
-> Index Scan using wrd_trgm on wrd (cost=0.29..37020.87 rows=479829 width=10) (actual time=187.219..188.252 rows=10.00 loops=1)
|
-> Index Scan using wrd_trgm on wrd (cost=0.29..37020.87 rows=479829 width=10) (actual time=187.219..188.252 rows=10.00 loops=1)
|
||||||
Order By: (word <-> 'caterpiler'::text)
|
Order By: (word <-> 'caterpiler'::text)
|
||||||
Index Searches: 1
|
|
||||||
Planning time: 0.196 ms
|
Planning time: 0.196 ms
|
||||||
Execution time: 198.640 ms
|
Execution time: 198.640 ms
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
@ -591,7 +591,6 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
|
|||||||
opaque = (BrinOpaque *) scan->opaque;
|
opaque = (BrinOpaque *) scan->opaque;
|
||||||
bdesc = opaque->bo_bdesc;
|
bdesc = opaque->bo_bdesc;
|
||||||
pgstat_count_index_scan(idxRel);
|
pgstat_count_index_scan(idxRel);
|
||||||
scan->nsearches++;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We need to know the size of the table so that we know how long to
|
* We need to know the size of the table so that we know how long to
|
||||||
|
@ -437,7 +437,6 @@ ginNewScanKey(IndexScanDesc scan)
|
|||||||
MemoryContextSwitchTo(oldCtx);
|
MemoryContextSwitchTo(oldCtx);
|
||||||
|
|
||||||
pgstat_count_index_scan(scan->indexRelation);
|
pgstat_count_index_scan(scan->indexRelation);
|
||||||
scan->nsearches++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -625,7 +625,6 @@ gistgettuple(IndexScanDesc scan, ScanDirection dir)
|
|||||||
GISTSearchItem fakeItem;
|
GISTSearchItem fakeItem;
|
||||||
|
|
||||||
pgstat_count_index_scan(scan->indexRelation);
|
pgstat_count_index_scan(scan->indexRelation);
|
||||||
scan->nsearches++;
|
|
||||||
|
|
||||||
so->firstCall = false;
|
so->firstCall = false;
|
||||||
so->curPageData = so->nPageData = 0;
|
so->curPageData = so->nPageData = 0;
|
||||||
@ -751,7 +750,6 @@ gistgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pgstat_count_index_scan(scan->indexRelation);
|
pgstat_count_index_scan(scan->indexRelation);
|
||||||
scan->nsearches++;
|
|
||||||
|
|
||||||
/* Begin the scan by processing the root page */
|
/* Begin the scan by processing the root page */
|
||||||
so->curPageData = so->nPageData = 0;
|
so->curPageData = so->nPageData = 0;
|
||||||
|
@ -298,7 +298,6 @@ _hash_first(IndexScanDesc scan, ScanDirection dir)
|
|||||||
HashScanPosItem *currItem;
|
HashScanPosItem *currItem;
|
||||||
|
|
||||||
pgstat_count_index_scan(rel);
|
pgstat_count_index_scan(rel);
|
||||||
scan->nsearches++;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We do not support hash scans with no index qualification, because we
|
* We do not support hash scans with no index qualification, because we
|
||||||
|
@ -119,7 +119,6 @@ RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
|
|||||||
scan->ignore_killed_tuples = !scan->xactStartedInRecovery;
|
scan->ignore_killed_tuples = !scan->xactStartedInRecovery;
|
||||||
|
|
||||||
scan->opaque = NULL;
|
scan->opaque = NULL;
|
||||||
scan->nsearches = 0;
|
|
||||||
|
|
||||||
scan->xs_itup = NULL;
|
scan->xs_itup = NULL;
|
||||||
scan->xs_itupdesc = NULL;
|
scan->xs_itupdesc = NULL;
|
||||||
|
@ -70,7 +70,6 @@ typedef struct BTParallelScanDescData
|
|||||||
BTPS_State btps_pageStatus; /* indicates whether next page is
|
BTPS_State btps_pageStatus; /* indicates whether next page is
|
||||||
* available for scan. see above for
|
* available for scan. see above for
|
||||||
* possible states of parallel scan. */
|
* possible states of parallel scan. */
|
||||||
uint64 btps_nsearches; /* tracked for IndexScanDescData.nsearches */
|
|
||||||
slock_t btps_mutex; /* protects above variables, btps_arrElems */
|
slock_t btps_mutex; /* protects above variables, btps_arrElems */
|
||||||
ConditionVariable btps_cv; /* used to synchronize parallel scan */
|
ConditionVariable btps_cv; /* used to synchronize parallel scan */
|
||||||
|
|
||||||
@ -558,7 +557,6 @@ btinitparallelscan(void *target)
|
|||||||
bt_target->btps_nextScanPage = InvalidBlockNumber;
|
bt_target->btps_nextScanPage = InvalidBlockNumber;
|
||||||
bt_target->btps_lastCurrPage = InvalidBlockNumber;
|
bt_target->btps_lastCurrPage = InvalidBlockNumber;
|
||||||
bt_target->btps_pageStatus = BTPARALLEL_NOT_INITIALIZED;
|
bt_target->btps_pageStatus = BTPARALLEL_NOT_INITIALIZED;
|
||||||
bt_target->btps_nsearches = 0;
|
|
||||||
ConditionVariableInit(&bt_target->btps_cv);
|
ConditionVariableInit(&bt_target->btps_cv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -585,7 +583,6 @@ btparallelrescan(IndexScanDesc scan)
|
|||||||
btscan->btps_nextScanPage = InvalidBlockNumber;
|
btscan->btps_nextScanPage = InvalidBlockNumber;
|
||||||
btscan->btps_lastCurrPage = InvalidBlockNumber;
|
btscan->btps_lastCurrPage = InvalidBlockNumber;
|
||||||
btscan->btps_pageStatus = BTPARALLEL_NOT_INITIALIZED;
|
btscan->btps_pageStatus = BTPARALLEL_NOT_INITIALIZED;
|
||||||
/* deliberately don't reset btps_nsearches (matches index_rescan) */
|
|
||||||
SpinLockRelease(&btscan->btps_mutex);
|
SpinLockRelease(&btscan->btps_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -679,7 +676,6 @@ _bt_parallel_seize(IndexScanDesc scan, BlockNumber *next_scan_page,
|
|||||||
{
|
{
|
||||||
/* Can start scheduled primitive scan right away, so do so */
|
/* Can start scheduled primitive scan right away, so do so */
|
||||||
btscan->btps_pageStatus = BTPARALLEL_ADVANCING;
|
btscan->btps_pageStatus = BTPARALLEL_ADVANCING;
|
||||||
btscan->btps_nsearches++;
|
|
||||||
for (int i = 0; i < so->numArrayKeys; i++)
|
for (int i = 0; i < so->numArrayKeys; i++)
|
||||||
{
|
{
|
||||||
BTArrayKeyInfo *array = &so->arrayKeys[i];
|
BTArrayKeyInfo *array = &so->arrayKeys[i];
|
||||||
@ -716,11 +712,6 @@ _bt_parallel_seize(IndexScanDesc scan, BlockNumber *next_scan_page,
|
|||||||
*/
|
*/
|
||||||
btscan->btps_pageStatus = BTPARALLEL_ADVANCING;
|
btscan->btps_pageStatus = BTPARALLEL_ADVANCING;
|
||||||
Assert(btscan->btps_nextScanPage != P_NONE);
|
Assert(btscan->btps_nextScanPage != P_NONE);
|
||||||
if (btscan->btps_nextScanPage == InvalidBlockNumber)
|
|
||||||
{
|
|
||||||
Assert(first);
|
|
||||||
btscan->btps_nsearches++;
|
|
||||||
}
|
|
||||||
*next_scan_page = btscan->btps_nextScanPage;
|
*next_scan_page = btscan->btps_nextScanPage;
|
||||||
*last_curr_page = btscan->btps_lastCurrPage;
|
*last_curr_page = btscan->btps_lastCurrPage;
|
||||||
exit_loop = true;
|
exit_loop = true;
|
||||||
@ -819,12 +810,6 @@ _bt_parallel_done(IndexScanDesc scan)
|
|||||||
btscan->btps_pageStatus = BTPARALLEL_DONE;
|
btscan->btps_pageStatus = BTPARALLEL_DONE;
|
||||||
status_changed = true;
|
status_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Don't use local nsearches counter -- overwrite it with the nsearches
|
|
||||||
* counter that we've been maintaining in shared memory
|
|
||||||
*/
|
|
||||||
scan->nsearches = btscan->btps_nsearches;
|
|
||||||
SpinLockRelease(&btscan->btps_mutex);
|
SpinLockRelease(&btscan->btps_mutex);
|
||||||
|
|
||||||
/* wake up all the workers associated with this parallel scan */
|
/* wake up all the workers associated with this parallel scan */
|
||||||
|
@ -950,7 +950,6 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
|||||||
* _bt_search/_bt_endpoint below
|
* _bt_search/_bt_endpoint below
|
||||||
*/
|
*/
|
||||||
pgstat_count_index_scan(rel);
|
pgstat_count_index_scan(rel);
|
||||||
scan->nsearches++;
|
|
||||||
|
|
||||||
/*----------
|
/*----------
|
||||||
* Examine the scan keys to discover where we need to start the scan.
|
* Examine the scan keys to discover where we need to start the scan.
|
||||||
|
@ -421,7 +421,6 @@ spgrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
|
|||||||
|
|
||||||
/* count an indexscan for stats */
|
/* count an indexscan for stats */
|
||||||
pgstat_count_index_scan(scan->indexRelation);
|
pgstat_count_index_scan(scan->indexRelation);
|
||||||
scan->nsearches++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
#include "access/relscan.h"
|
|
||||||
#include "access/xact.h"
|
#include "access/xact.h"
|
||||||
#include "catalog/pg_type.h"
|
#include "catalog/pg_type.h"
|
||||||
#include "commands/createas.h"
|
#include "commands/createas.h"
|
||||||
@ -126,7 +125,6 @@ static void show_recursive_union_info(RecursiveUnionState *rstate,
|
|||||||
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
|
static void show_memoize_info(MemoizeState *mstate, List *ancestors,
|
||||||
ExplainState *es);
|
ExplainState *es);
|
||||||
static void show_hashagg_info(AggState *aggstate, ExplainState *es);
|
static void show_hashagg_info(AggState *aggstate, ExplainState *es);
|
||||||
static void show_indexsearches_info(PlanState *planstate, ExplainState *es);
|
|
||||||
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
|
static void show_tidbitmap_info(BitmapHeapScanState *planstate,
|
||||||
ExplainState *es);
|
ExplainState *es);
|
||||||
static void show_instrumentation_count(const char *qlabel, int which,
|
static void show_instrumentation_count(const char *qlabel, int which,
|
||||||
@ -2098,7 +2096,6 @@ ExplainNode(PlanState *planstate, List *ancestors,
|
|||||||
if (plan->qual)
|
if (plan->qual)
|
||||||
show_instrumentation_count("Rows Removed by Filter", 1,
|
show_instrumentation_count("Rows Removed by Filter", 1,
|
||||||
planstate, es);
|
planstate, es);
|
||||||
show_indexsearches_info(planstate, es);
|
|
||||||
break;
|
break;
|
||||||
case T_IndexOnlyScan:
|
case T_IndexOnlyScan:
|
||||||
show_scan_qual(((IndexOnlyScan *) plan)->indexqual,
|
show_scan_qual(((IndexOnlyScan *) plan)->indexqual,
|
||||||
@ -2115,12 +2112,10 @@ ExplainNode(PlanState *planstate, List *ancestors,
|
|||||||
if (es->analyze)
|
if (es->analyze)
|
||||||
ExplainPropertyFloat("Heap Fetches", NULL,
|
ExplainPropertyFloat("Heap Fetches", NULL,
|
||||||
planstate->instrument->ntuples2, 0, es);
|
planstate->instrument->ntuples2, 0, es);
|
||||||
show_indexsearches_info(planstate, es);
|
|
||||||
break;
|
break;
|
||||||
case T_BitmapIndexScan:
|
case T_BitmapIndexScan:
|
||||||
show_scan_qual(((BitmapIndexScan *) plan)->indexqualorig,
|
show_scan_qual(((BitmapIndexScan *) plan)->indexqualorig,
|
||||||
"Index Cond", planstate, ancestors, es);
|
"Index Cond", planstate, ancestors, es);
|
||||||
show_indexsearches_info(planstate, es);
|
|
||||||
break;
|
break;
|
||||||
case T_BitmapHeapScan:
|
case T_BitmapHeapScan:
|
||||||
show_scan_qual(((BitmapHeapScan *) plan)->bitmapqualorig,
|
show_scan_qual(((BitmapHeapScan *) plan)->bitmapqualorig,
|
||||||
@ -3860,41 +3855,6 @@ show_hashagg_info(AggState *aggstate, ExplainState *es)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Show the total number of index searches performed by a
|
|
||||||
* IndexScan/IndexOnlyScan/BitmapIndexScan node
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
show_indexsearches_info(PlanState *planstate, ExplainState *es)
|
|
||||||
{
|
|
||||||
Plan *plan = planstate->plan;
|
|
||||||
struct IndexScanDescData *scanDesc = NULL;
|
|
||||||
uint64 nsearches = 0;
|
|
||||||
|
|
||||||
if (!es->analyze)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (nodeTag(plan))
|
|
||||||
{
|
|
||||||
case T_IndexScan:
|
|
||||||
scanDesc = ((IndexScanState *) planstate)->iss_ScanDesc;
|
|
||||||
break;
|
|
||||||
case T_IndexOnlyScan:
|
|
||||||
scanDesc = ((IndexOnlyScanState *) planstate)->ioss_ScanDesc;
|
|
||||||
break;
|
|
||||||
case T_BitmapIndexScan:
|
|
||||||
scanDesc = ((BitmapIndexScanState *) planstate)->biss_ScanDesc;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (scanDesc)
|
|
||||||
nsearches = scanDesc->nsearches;
|
|
||||||
|
|
||||||
ExplainPropertyUInteger("Index Searches", NULL, nsearches, es);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Show exact/lossy pages for a BitmapHeapScan node
|
* Show exact/lossy pages for a BitmapHeapScan node
|
||||||
*/
|
*/
|
||||||
|
@ -150,13 +150,6 @@ typedef struct IndexScanDescData
|
|||||||
/* index access method's private state */
|
/* index access method's private state */
|
||||||
void *opaque; /* access-method-specific info */
|
void *opaque; /* access-method-specific info */
|
||||||
|
|
||||||
/*
|
|
||||||
* Instrumentation counters that are maintained by every index access
|
|
||||||
* method, for all scan types. These go here because there is no standard
|
|
||||||
* way to access PlanState.instrument during amgettuple calls.
|
|
||||||
*/
|
|
||||||
uint64 nsearches; /* total # of index searches */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* In an index-only scan, a successful amgettuple call must fill either
|
* In an index-only scan, a successful amgettuple call must fill either
|
||||||
* xs_itup (and xs_itupdesc) or xs_hitup (and xs_hitupdesc) to provide the
|
* xs_itup (and xs_itupdesc) or xs_hitup (and xs_hitupdesc) to provide the
|
||||||
|
@ -853,8 +853,7 @@ SELECT * FROM brin_date_test WHERE a = '2023-01-01'::date;
|
|||||||
Recheck Cond: (a = '2023-01-01'::date)
|
Recheck Cond: (a = '2023-01-01'::date)
|
||||||
-> Bitmap Index Scan on brin_date_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_date_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '2023-01-01'::date)
|
Index Cond: (a = '2023-01-01'::date)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
DROP TABLE brin_date_test;
|
DROP TABLE brin_date_test;
|
||||||
RESET enable_seqscan;
|
RESET enable_seqscan;
|
||||||
@ -873,8 +872,7 @@ SELECT * FROM brin_timestamp_test WHERE a = '2023-01-01'::timestamp;
|
|||||||
Recheck Cond: (a = '2023-01-01 00:00:00'::timestamp without time zone)
|
Recheck Cond: (a = '2023-01-01 00:00:00'::timestamp without time zone)
|
||||||
-> Bitmap Index Scan on brin_timestamp_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_timestamp_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '2023-01-01 00:00:00'::timestamp without time zone)
|
Index Cond: (a = '2023-01-01 00:00:00'::timestamp without time zone)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
||||||
SELECT * FROM brin_timestamp_test WHERE a = '1900-01-01'::timestamp;
|
SELECT * FROM brin_timestamp_test WHERE a = '1900-01-01'::timestamp;
|
||||||
@ -884,8 +882,7 @@ SELECT * FROM brin_timestamp_test WHERE a = '1900-01-01'::timestamp;
|
|||||||
Recheck Cond: (a = '1900-01-01 00:00:00'::timestamp without time zone)
|
Recheck Cond: (a = '1900-01-01 00:00:00'::timestamp without time zone)
|
||||||
-> Bitmap Index Scan on brin_timestamp_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_timestamp_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '1900-01-01 00:00:00'::timestamp without time zone)
|
Index Cond: (a = '1900-01-01 00:00:00'::timestamp without time zone)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
DROP TABLE brin_timestamp_test;
|
DROP TABLE brin_timestamp_test;
|
||||||
RESET enable_seqscan;
|
RESET enable_seqscan;
|
||||||
@ -903,8 +900,7 @@ SELECT * FROM brin_date_test WHERE a = '2023-01-01'::date;
|
|||||||
Recheck Cond: (a = '2023-01-01'::date)
|
Recheck Cond: (a = '2023-01-01'::date)
|
||||||
-> Bitmap Index Scan on brin_date_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_date_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '2023-01-01'::date)
|
Index Cond: (a = '2023-01-01'::date)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
||||||
SELECT * FROM brin_date_test WHERE a = '1900-01-01'::date;
|
SELECT * FROM brin_date_test WHERE a = '1900-01-01'::date;
|
||||||
@ -914,8 +910,7 @@ SELECT * FROM brin_date_test WHERE a = '1900-01-01'::date;
|
|||||||
Recheck Cond: (a = '1900-01-01'::date)
|
Recheck Cond: (a = '1900-01-01'::date)
|
||||||
-> Bitmap Index Scan on brin_date_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_date_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '1900-01-01'::date)
|
Index Cond: (a = '1900-01-01'::date)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
DROP TABLE brin_date_test;
|
DROP TABLE brin_date_test;
|
||||||
RESET enable_seqscan;
|
RESET enable_seqscan;
|
||||||
@ -934,8 +929,7 @@ SELECT * FROM brin_interval_test WHERE a = '-30 years'::interval;
|
|||||||
Recheck Cond: (a = '@ 30 years ago'::interval)
|
Recheck Cond: (a = '@ 30 years ago'::interval)
|
||||||
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '@ 30 years ago'::interval)
|
Index Cond: (a = '@ 30 years ago'::interval)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
||||||
SELECT * FROM brin_interval_test WHERE a = '30 years'::interval;
|
SELECT * FROM brin_interval_test WHERE a = '30 years'::interval;
|
||||||
@ -945,8 +939,7 @@ SELECT * FROM brin_interval_test WHERE a = '30 years'::interval;
|
|||||||
Recheck Cond: (a = '@ 30 years'::interval)
|
Recheck Cond: (a = '@ 30 years'::interval)
|
||||||
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '@ 30 years'::interval)
|
Index Cond: (a = '@ 30 years'::interval)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
DROP TABLE brin_interval_test;
|
DROP TABLE brin_interval_test;
|
||||||
RESET enable_seqscan;
|
RESET enable_seqscan;
|
||||||
@ -964,8 +957,7 @@ SELECT * FROM brin_interval_test WHERE a = '-30 years'::interval;
|
|||||||
Recheck Cond: (a = '@ 30 years ago'::interval)
|
Recheck Cond: (a = '@ 30 years ago'::interval)
|
||||||
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '@ 30 years ago'::interval)
|
Index Cond: (a = '@ 30 years ago'::interval)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF, SUMMARY OFF, BUFFERS OFF)
|
||||||
SELECT * FROM brin_interval_test WHERE a = '30 years'::interval;
|
SELECT * FROM brin_interval_test WHERE a = '30 years'::interval;
|
||||||
@ -975,8 +967,7 @@ SELECT * FROM brin_interval_test WHERE a = '30 years'::interval;
|
|||||||
Recheck Cond: (a = '@ 30 years'::interval)
|
Recheck Cond: (a = '@ 30 years'::interval)
|
||||||
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on brin_interval_test_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = '@ 30 years'::interval)
|
Index Cond: (a = '@ 30 years'::interval)
|
||||||
Index Searches: 1
|
(4 rows)
|
||||||
(5 rows)
|
|
||||||
|
|
||||||
DROP TABLE brin_interval_test;
|
DROP TABLE brin_interval_test;
|
||||||
RESET enable_seqscan;
|
RESET enable_seqscan;
|
||||||
|
@ -24,7 +24,6 @@ begin
|
|||||||
ln := regexp_replace(ln, 'Memory Usage: \d+', 'Memory Usage: N');
|
ln := regexp_replace(ln, 'Memory Usage: \d+', 'Memory Usage: N');
|
||||||
ln := regexp_replace(ln, 'Heap Fetches: \d+', 'Heap Fetches: N');
|
ln := regexp_replace(ln, 'Heap Fetches: \d+', 'Heap Fetches: N');
|
||||||
ln := regexp_replace(ln, 'loops=\d+', 'loops=N');
|
ln := regexp_replace(ln, 'loops=\d+', 'loops=N');
|
||||||
ln := regexp_replace(ln, 'Index Searches: \d+', 'Index Searches: N');
|
|
||||||
return next ln;
|
return next ln;
|
||||||
end loop;
|
end loop;
|
||||||
end;
|
end;
|
||||||
@ -50,8 +49,7 @@ WHERE t2.unique1 < 1000;', false);
|
|||||||
-> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N)
|
-> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N)
|
||||||
Index Cond: (unique1 = t2.twenty)
|
Index Cond: (unique1 = t2.twenty)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(12 rows)
|
||||||
(13 rows)
|
|
||||||
|
|
||||||
-- And check we get the expected results.
|
-- And check we get the expected results.
|
||||||
SELECT COUNT(*),AVG(t1.unique1) FROM tenk1 t1
|
SELECT COUNT(*),AVG(t1.unique1) FROM tenk1 t1
|
||||||
@ -82,8 +80,7 @@ WHERE t1.unique1 < 1000;', false);
|
|||||||
-> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1.00 loops=N)
|
-> Index Only Scan using tenk1_unique1 on tenk1 t2 (actual rows=1.00 loops=N)
|
||||||
Index Cond: (unique1 = t1.twenty)
|
Index Cond: (unique1 = t1.twenty)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(12 rows)
|
||||||
(13 rows)
|
|
||||||
|
|
||||||
-- And check we get the expected results.
|
-- And check we get the expected results.
|
||||||
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
SELECT COUNT(*),AVG(t2.unique1) FROM tenk1 t1,
|
||||||
@ -109,7 +106,6 @@ WHERE t1.unique1 < 10;', false);
|
|||||||
-> Nested Loop Left Join (actual rows=20.00 loops=N)
|
-> Nested Loop Left Join (actual rows=20.00 loops=N)
|
||||||
-> Index Scan using tenk1_unique1 on tenk1 t1 (actual rows=10.00 loops=N)
|
-> Index Scan using tenk1_unique1 on tenk1 t1 (actual rows=10.00 loops=N)
|
||||||
Index Cond: (unique1 < 10)
|
Index Cond: (unique1 < 10)
|
||||||
Index Searches: N
|
|
||||||
-> Memoize (actual rows=2.00 loops=N)
|
-> Memoize (actual rows=2.00 loops=N)
|
||||||
Cache Key: t1.two
|
Cache Key: t1.two
|
||||||
Cache Mode: binary
|
Cache Mode: binary
|
||||||
@ -119,8 +115,7 @@ WHERE t1.unique1 < 10;', false);
|
|||||||
Rows Removed by Filter: 2
|
Rows Removed by Filter: 2
|
||||||
-> Index Scan using tenk1_unique1 on tenk1 t2_1 (actual rows=4.00 loops=N)
|
-> Index Scan using tenk1_unique1 on tenk1 t2_1 (actual rows=4.00 loops=N)
|
||||||
Index Cond: (unique1 < 4)
|
Index Cond: (unique1 < 4)
|
||||||
Index Searches: N
|
(13 rows)
|
||||||
(15 rows)
|
|
||||||
|
|
||||||
-- And check we get the expected results.
|
-- And check we get the expected results.
|
||||||
SELECT COUNT(*),AVG(t2.t1two) FROM tenk1 t1 LEFT JOIN
|
SELECT COUNT(*),AVG(t2.t1two) FROM tenk1 t1 LEFT JOIN
|
||||||
@ -154,8 +149,7 @@ WHERE s.c1 = s.c2 AND t1.unique1 < 1000;', false);
|
|||||||
Filter: ((t1.two + 1) = unique1)
|
Filter: ((t1.two + 1) = unique1)
|
||||||
Rows Removed by Filter: 9999
|
Rows Removed by Filter: 9999
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(13 rows)
|
||||||
(14 rows)
|
|
||||||
|
|
||||||
-- And check we get the expected results.
|
-- And check we get the expected results.
|
||||||
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN
|
SELECT COUNT(*), AVG(t1.twenty) FROM tenk1 t1 LEFT JOIN
|
||||||
@ -225,8 +219,7 @@ ON t1.x = t2.t::numeric AND t1.t::numeric = t2.x;', false);
|
|||||||
Index Cond: (x = (t1.t)::numeric)
|
Index Cond: (x = (t1.t)::numeric)
|
||||||
Filter: (t1.x = (t)::numeric)
|
Filter: (t1.x = (t)::numeric)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(10 rows)
|
||||||
(11 rows)
|
|
||||||
|
|
||||||
DROP TABLE expr_key;
|
DROP TABLE expr_key;
|
||||||
-- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions
|
-- Reduce work_mem and hash_mem_multiplier so that we see some cache evictions
|
||||||
@ -253,8 +246,7 @@ WHERE t2.unique1 < 1200;', true);
|
|||||||
-> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N)
|
-> Index Only Scan using tenk1_unique1 on tenk1 t1 (actual rows=1.00 loops=N)
|
||||||
Index Cond: (unique1 = t2.thousand)
|
Index Cond: (unique1 = t2.thousand)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(12 rows)
|
||||||
(13 rows)
|
|
||||||
|
|
||||||
CREATE TABLE flt (f float);
|
CREATE TABLE flt (f float);
|
||||||
CREATE INDEX flt_f_idx ON flt (f);
|
CREATE INDEX flt_f_idx ON flt (f);
|
||||||
@ -269,7 +261,6 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f = f2.f;', false);
|
|||||||
Nested Loop (actual rows=4.00 loops=N)
|
Nested Loop (actual rows=4.00 loops=N)
|
||||||
-> Index Only Scan using flt_f_idx on flt f1 (actual rows=2.00 loops=N)
|
-> Index Only Scan using flt_f_idx on flt f1 (actual rows=2.00 loops=N)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Memoize (actual rows=2.00 loops=N)
|
-> Memoize (actual rows=2.00 loops=N)
|
||||||
Cache Key: f1.f
|
Cache Key: f1.f
|
||||||
Cache Mode: logical
|
Cache Mode: logical
|
||||||
@ -277,8 +268,7 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f = f2.f;', false);
|
|||||||
-> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N)
|
-> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N)
|
||||||
Index Cond: (f = f1.f)
|
Index Cond: (f = f1.f)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(10 rows)
|
||||||
(12 rows)
|
|
||||||
|
|
||||||
-- Ensure memoize operates in binary mode
|
-- Ensure memoize operates in binary mode
|
||||||
SELECT explain_memoize('
|
SELECT explain_memoize('
|
||||||
@ -288,7 +278,6 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f >= f2.f;', false);
|
|||||||
Nested Loop (actual rows=4.00 loops=N)
|
Nested Loop (actual rows=4.00 loops=N)
|
||||||
-> Index Only Scan using flt_f_idx on flt f1 (actual rows=2.00 loops=N)
|
-> Index Only Scan using flt_f_idx on flt f1 (actual rows=2.00 loops=N)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Memoize (actual rows=2.00 loops=N)
|
-> Memoize (actual rows=2.00 loops=N)
|
||||||
Cache Key: f1.f
|
Cache Key: f1.f
|
||||||
Cache Mode: binary
|
Cache Mode: binary
|
||||||
@ -296,8 +285,7 @@ SELECT * FROM flt f1 INNER JOIN flt f2 ON f1.f >= f2.f;', false);
|
|||||||
-> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N)
|
-> Index Only Scan using flt_f_idx on flt f2 (actual rows=2.00 loops=N)
|
||||||
Index Cond: (f <= f1.f)
|
Index Cond: (f <= f1.f)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(10 rows)
|
||||||
(12 rows)
|
|
||||||
|
|
||||||
DROP TABLE flt;
|
DROP TABLE flt;
|
||||||
-- Exercise Memoize in binary mode with a large fixed width type and a
|
-- Exercise Memoize in binary mode with a large fixed width type and a
|
||||||
@ -323,8 +311,7 @@ SELECT * FROM strtest s1 INNER JOIN strtest s2 ON s1.n >= s2.n;', false);
|
|||||||
Hits: 3 Misses: 3 Evictions: Zero Overflows: 0 Memory Usage: NkB
|
Hits: 3 Misses: 3 Evictions: Zero Overflows: 0 Memory Usage: NkB
|
||||||
-> Index Scan using strtest_n_idx on strtest s2 (actual rows=4.00 loops=N)
|
-> Index Scan using strtest_n_idx on strtest s2 (actual rows=4.00 loops=N)
|
||||||
Index Cond: (n <= s1.n)
|
Index Cond: (n <= s1.n)
|
||||||
Index Searches: N
|
(9 rows)
|
||||||
(10 rows)
|
|
||||||
|
|
||||||
-- Ensure we get 3 hits and 3 misses
|
-- Ensure we get 3 hits and 3 misses
|
||||||
SELECT explain_memoize('
|
SELECT explain_memoize('
|
||||||
@ -340,8 +327,7 @@ SELECT * FROM strtest s1 INNER JOIN strtest s2 ON s1.t >= s2.t;', false);
|
|||||||
Hits: 3 Misses: 3 Evictions: Zero Overflows: 0 Memory Usage: NkB
|
Hits: 3 Misses: 3 Evictions: Zero Overflows: 0 Memory Usage: NkB
|
||||||
-> Index Scan using strtest_t_idx on strtest s2 (actual rows=4.00 loops=N)
|
-> Index Scan using strtest_t_idx on strtest s2 (actual rows=4.00 loops=N)
|
||||||
Index Cond: (t <= s1.t)
|
Index Cond: (t <= s1.t)
|
||||||
Index Searches: N
|
(9 rows)
|
||||||
(10 rows)
|
|
||||||
|
|
||||||
DROP TABLE strtest;
|
DROP TABLE strtest;
|
||||||
-- Ensure memoize works with partitionwise join
|
-- Ensure memoize works with partitionwise join
|
||||||
@ -362,7 +348,6 @@ SELECT * FROM prt t1 INNER JOIN prt t2 ON t1.a = t2.a;', false);
|
|||||||
-> Nested Loop (actual rows=16.00 loops=N)
|
-> Nested Loop (actual rows=16.00 loops=N)
|
||||||
-> Index Only Scan using iprt_p1_a on prt_p1 t1_1 (actual rows=4.00 loops=N)
|
-> Index Only Scan using iprt_p1_a on prt_p1 t1_1 (actual rows=4.00 loops=N)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Memoize (actual rows=4.00 loops=N)
|
-> Memoize (actual rows=4.00 loops=N)
|
||||||
Cache Key: t1_1.a
|
Cache Key: t1_1.a
|
||||||
Cache Mode: logical
|
Cache Mode: logical
|
||||||
@ -370,11 +355,9 @@ SELECT * FROM prt t1 INNER JOIN prt t2 ON t1.a = t2.a;', false);
|
|||||||
-> Index Only Scan using iprt_p1_a on prt_p1 t2_1 (actual rows=4.00 loops=N)
|
-> Index Only Scan using iprt_p1_a on prt_p1 t2_1 (actual rows=4.00 loops=N)
|
||||||
Index Cond: (a = t1_1.a)
|
Index Cond: (a = t1_1.a)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Nested Loop (actual rows=16.00 loops=N)
|
-> Nested Loop (actual rows=16.00 loops=N)
|
||||||
-> Index Only Scan using iprt_p2_a on prt_p2 t1_2 (actual rows=4.00 loops=N)
|
-> Index Only Scan using iprt_p2_a on prt_p2 t1_2 (actual rows=4.00 loops=N)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Memoize (actual rows=4.00 loops=N)
|
-> Memoize (actual rows=4.00 loops=N)
|
||||||
Cache Key: t1_2.a
|
Cache Key: t1_2.a
|
||||||
Cache Mode: logical
|
Cache Mode: logical
|
||||||
@ -382,8 +365,7 @@ SELECT * FROM prt t1 INNER JOIN prt t2 ON t1.a = t2.a;', false);
|
|||||||
-> Index Only Scan using iprt_p2_a on prt_p2 t2_2 (actual rows=4.00 loops=N)
|
-> Index Only Scan using iprt_p2_a on prt_p2 t2_2 (actual rows=4.00 loops=N)
|
||||||
Index Cond: (a = t1_2.a)
|
Index Cond: (a = t1_2.a)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(21 rows)
|
||||||
(25 rows)
|
|
||||||
|
|
||||||
-- Ensure memoize works with parameterized union-all Append path
|
-- Ensure memoize works with parameterized union-all Append path
|
||||||
SET enable_partitionwise_join TO off;
|
SET enable_partitionwise_join TO off;
|
||||||
@ -396,7 +378,6 @@ ON t1.a = t2.a;', false);
|
|||||||
Nested Loop (actual rows=16.00 loops=N)
|
Nested Loop (actual rows=16.00 loops=N)
|
||||||
-> Index Only Scan using iprt_p1_a on prt_p1 t1 (actual rows=4.00 loops=N)
|
-> Index Only Scan using iprt_p1_a on prt_p1 t1 (actual rows=4.00 loops=N)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Memoize (actual rows=4.00 loops=N)
|
-> Memoize (actual rows=4.00 loops=N)
|
||||||
Cache Key: t1.a
|
Cache Key: t1.a
|
||||||
Cache Mode: logical
|
Cache Mode: logical
|
||||||
@ -405,12 +386,10 @@ ON t1.a = t2.a;', false);
|
|||||||
-> Index Only Scan using iprt_p1_a on prt_p1 (actual rows=4.00 loops=N)
|
-> Index Only Scan using iprt_p1_a on prt_p1 (actual rows=4.00 loops=N)
|
||||||
Index Cond: (a = t1.a)
|
Index Cond: (a = t1.a)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
|
||||||
-> Index Only Scan using iprt_p2_a on prt_p2 (actual rows=0.00 loops=N)
|
-> Index Only Scan using iprt_p2_a on prt_p2 (actual rows=0.00 loops=N)
|
||||||
Index Cond: (a = t1.a)
|
Index Cond: (a = t1.a)
|
||||||
Heap Fetches: N
|
Heap Fetches: N
|
||||||
Index Searches: N
|
(14 rows)
|
||||||
(17 rows)
|
|
||||||
|
|
||||||
DROP TABLE prt;
|
DROP TABLE prt;
|
||||||
RESET enable_partitionwise_join;
|
RESET enable_partitionwise_join;
|
||||||
|
@ -2369,10 +2369,6 @@ begin
|
|||||||
ln := regexp_replace(ln, 'Workers Launched: \d+', 'Workers Launched: N');
|
ln := regexp_replace(ln, 'Workers Launched: \d+', 'Workers Launched: N');
|
||||||
ln := regexp_replace(ln, 'actual rows=\d+(?:\.\d+)? loops=\d+', 'actual rows=N loops=N');
|
ln := regexp_replace(ln, 'actual rows=\d+(?:\.\d+)? loops=\d+', 'actual rows=N loops=N');
|
||||||
ln := regexp_replace(ln, 'Rows Removed by Filter: \d+', 'Rows Removed by Filter: N');
|
ln := regexp_replace(ln, 'Rows Removed by Filter: \d+', 'Rows Removed by Filter: N');
|
||||||
perform regexp_matches(ln, 'Index Searches: \d+');
|
|
||||||
if found then
|
|
||||||
continue;
|
|
||||||
end if;
|
|
||||||
return next ln;
|
return next ln;
|
||||||
end loop;
|
end loop;
|
||||||
end;
|
end;
|
||||||
@ -2690,56 +2686,47 @@ select * from ab where a = (select max(a) from lprt_a) and b = (select max(a)-1
|
|||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b1_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b1_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b2 ab_2 (never executed)
|
-> Bitmap Heap Scan on ab_a1_b2 ab_2 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b2_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b2_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b3 ab_3 (never executed)
|
-> Bitmap Heap Scan on ab_a1_b3 ab_3 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b3_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b3_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a2_b1 ab_4 (never executed)
|
-> Bitmap Heap Scan on ab_a2_b1 ab_4 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a2_b1_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a2_b1_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a2_b2 ab_5 (never executed)
|
-> Bitmap Heap Scan on ab_a2_b2 ab_5 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a2_b2_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a2_b2_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a2_b3 ab_6 (never executed)
|
-> Bitmap Heap Scan on ab_a2_b3 ab_6 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a2_b3_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a2_b3_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a3_b1 ab_7 (never executed)
|
-> Bitmap Heap Scan on ab_a3_b1 ab_7 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a3_b1_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a3_b1_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a3_b2 ab_8 (actual rows=0.00 loops=1)
|
-> Bitmap Heap Scan on ab_a3_b2 ab_8 (actual rows=0.00 loops=1)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a3_b2_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on ab_a3_b2_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a3_b3 ab_9 (never executed)
|
-> Bitmap Heap Scan on ab_a3_b3 ab_9 (never executed)
|
||||||
Recheck Cond: (a = (InitPlan 1).col1)
|
Recheck Cond: (a = (InitPlan 1).col1)
|
||||||
Filter: (b = (InitPlan 2).col1)
|
Filter: (b = (InitPlan 2).col1)
|
||||||
-> Bitmap Index Scan on ab_a3_b3_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a3_b3_a_idx (never executed)
|
||||||
Index Cond: (a = (InitPlan 1).col1)
|
Index Cond: (a = (InitPlan 1).col1)
|
||||||
Index Searches: 0
|
(52 rows)
|
||||||
(61 rows)
|
|
||||||
|
|
||||||
-- Test run-time partition pruning with UNION ALL parents
|
-- Test run-time partition pruning with UNION ALL parents
|
||||||
explain (analyze, costs off, summary off, timing off, buffers off)
|
explain (analyze, costs off, summary off, timing off, buffers off)
|
||||||
@ -2755,19 +2742,16 @@ select * from (select * from ab where a = 1 union all select * from ab) ab where
|
|||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b2 ab_12 (never executed)
|
-> Bitmap Heap Scan on ab_a1_b2 ab_12 (never executed)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b2_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b2_a_idx (never executed)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b3 ab_13 (never executed)
|
-> Bitmap Heap Scan on ab_a1_b3 ab_13 (never executed)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b3_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b3_a_idx (never executed)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 0
|
|
||||||
-> Seq Scan on ab_a1_b1 ab_1 (actual rows=0.00 loops=1)
|
-> Seq Scan on ab_a1_b1 ab_1 (actual rows=0.00 loops=1)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Seq Scan on ab_a1_b2 ab_2 (never executed)
|
-> Seq Scan on ab_a1_b2 ab_2 (never executed)
|
||||||
@ -2786,7 +2770,7 @@ select * from (select * from ab where a = 1 union all select * from ab) ab where
|
|||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Seq Scan on ab_a3_b3 ab_9 (never executed)
|
-> Seq Scan on ab_a3_b3 ab_9 (never executed)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
(40 rows)
|
(37 rows)
|
||||||
|
|
||||||
-- A case containing a UNION ALL with a non-partitioned child.
|
-- A case containing a UNION ALL with a non-partitioned child.
|
||||||
explain (analyze, costs off, summary off, timing off, buffers off)
|
explain (analyze, costs off, summary off, timing off, buffers off)
|
||||||
@ -2802,19 +2786,16 @@ select * from (select * from ab where a = 1 union all (values(10,5)) union all s
|
|||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b2 ab_12 (never executed)
|
-> Bitmap Heap Scan on ab_a1_b2 ab_12 (never executed)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b2_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b2_a_idx (never executed)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 0
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b3 ab_13 (never executed)
|
-> Bitmap Heap Scan on ab_a1_b3 ab_13 (never executed)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Bitmap Index Scan on ab_a1_b3_a_idx (never executed)
|
-> Bitmap Index Scan on ab_a1_b3_a_idx (never executed)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 0
|
|
||||||
-> Result (actual rows=0.00 loops=1)
|
-> Result (actual rows=0.00 loops=1)
|
||||||
One-Time Filter: (5 = (InitPlan 1).col1)
|
One-Time Filter: (5 = (InitPlan 1).col1)
|
||||||
-> Seq Scan on ab_a1_b1 ab_1 (actual rows=0.00 loops=1)
|
-> Seq Scan on ab_a1_b1 ab_1 (actual rows=0.00 loops=1)
|
||||||
@ -2835,7 +2816,7 @@ select * from (select * from ab where a = 1 union all (values(10,5)) union all s
|
|||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
-> Seq Scan on ab_a3_b3 ab_9 (never executed)
|
-> Seq Scan on ab_a3_b3 ab_9 (never executed)
|
||||||
Filter: (b = (InitPlan 1).col1)
|
Filter: (b = (InitPlan 1).col1)
|
||||||
(42 rows)
|
(39 rows)
|
||||||
|
|
||||||
-- Another UNION ALL test, but containing a mix of exec init and exec run-time pruning.
|
-- Another UNION ALL test, but containing a mix of exec init and exec run-time pruning.
|
||||||
create table xy_1 (x int, y int);
|
create table xy_1 (x int, y int);
|
||||||
@ -2906,19 +2887,16 @@ update ab_a1 set b = 3 from ab where ab.a = 1 and ab.a = ab_a1.a;');
|
|||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b2 ab_a1_2 (actual rows=1.00 loops=1)
|
-> Bitmap Heap Scan on ab_a1_b2 ab_a1_2 (actual rows=1.00 loops=1)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Heap Blocks: exact=1
|
Heap Blocks: exact=1
|
||||||
-> Bitmap Index Scan on ab_a1_b2_a_idx (actual rows=1.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b2_a_idx (actual rows=1.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b3 ab_a1_3 (actual rows=0.00 loops=1)
|
-> Bitmap Heap Scan on ab_a1_b3 ab_a1_3 (actual rows=0.00 loops=1)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Heap Blocks: exact=1
|
Heap Blocks: exact=1
|
||||||
-> Bitmap Index Scan on ab_a1_b3_a_idx (actual rows=1.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b3_a_idx (actual rows=1.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Materialize (actual rows=1.00 loops=1)
|
-> Materialize (actual rows=1.00 loops=1)
|
||||||
Storage: Memory Maximum Storage: NkB
|
Storage: Memory Maximum Storage: NkB
|
||||||
-> Append (actual rows=1.00 loops=1)
|
-> Append (actual rows=1.00 loops=1)
|
||||||
@ -2926,20 +2904,17 @@ update ab_a1 set b = 3 from ab where ab.a = 1 and ab.a = ab_a1.a;');
|
|||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b1_a_idx (actual rows=0.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b2 ab_2 (actual rows=1.00 loops=1)
|
-> Bitmap Heap Scan on ab_a1_b2 ab_2 (actual rows=1.00 loops=1)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Heap Blocks: exact=1
|
Heap Blocks: exact=1
|
||||||
-> Bitmap Index Scan on ab_a1_b2_a_idx (actual rows=1.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b2_a_idx (actual rows=1.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
|
||||||
-> Bitmap Heap Scan on ab_a1_b3 ab_3 (actual rows=0.00 loops=1)
|
-> Bitmap Heap Scan on ab_a1_b3 ab_3 (actual rows=0.00 loops=1)
|
||||||
Recheck Cond: (a = 1)
|
Recheck Cond: (a = 1)
|
||||||
Heap Blocks: exact=1
|
Heap Blocks: exact=1
|
||||||
-> Bitmap Index Scan on ab_a1_b3_a_idx (actual rows=1.00 loops=1)
|
-> Bitmap Index Scan on ab_a1_b3_a_idx (actual rows=1.00 loops=1)
|
||||||
Index Cond: (a = 1)
|
Index Cond: (a = 1)
|
||||||
Index Searches: 1
|
(37 rows)
|
||||||
(43 rows)
|
|
||||||
|
|
||||||
table ab;
|
table ab;
|
||||||
a | b
|
a | b
|
||||||
@ -3015,23 +2990,17 @@ select * from tbl1 join tprt on tbl1.col1 > tprt.col1;
|
|||||||
-> Append (actual rows=3.00 loops=2)
|
-> Append (actual rows=3.00 loops=2)
|
||||||
-> Index Scan using tprt1_idx on tprt_1 (actual rows=2.00 loops=2)
|
-> Index Scan using tprt1_idx on tprt_1 (actual rows=2.00 loops=2)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 2
|
|
||||||
-> Index Scan using tprt2_idx on tprt_2 (actual rows=2.00 loops=1)
|
-> Index Scan using tprt2_idx on tprt_2 (actual rows=2.00 loops=1)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 1
|
|
||||||
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
(15 rows)
|
||||||
(21 rows)
|
|
||||||
|
|
||||||
explain (analyze, costs off, summary off, timing off, buffers off)
|
explain (analyze, costs off, summary off, timing off, buffers off)
|
||||||
select * from tbl1 join tprt on tbl1.col1 = tprt.col1;
|
select * from tbl1 join tprt on tbl1.col1 = tprt.col1;
|
||||||
@ -3042,23 +3011,17 @@ select * from tbl1 join tprt on tbl1.col1 = tprt.col1;
|
|||||||
-> Append (actual rows=1.00 loops=2)
|
-> Append (actual rows=1.00 loops=2)
|
||||||
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt2_idx on tprt_2 (actual rows=1.00 loops=2)
|
-> Index Scan using tprt2_idx on tprt_2 (actual rows=1.00 loops=2)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 2
|
|
||||||
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
(15 rows)
|
||||||
(21 rows)
|
|
||||||
|
|
||||||
select tbl1.col1, tprt.col1 from tbl1
|
select tbl1.col1, tprt.col1 from tbl1
|
||||||
inner join tprt on tbl1.col1 > tprt.col1
|
inner join tprt on tbl1.col1 > tprt.col1
|
||||||
@ -3093,23 +3056,17 @@ select * from tbl1 inner join tprt on tbl1.col1 > tprt.col1;
|
|||||||
-> Append (actual rows=4.60 loops=5)
|
-> Append (actual rows=4.60 loops=5)
|
||||||
-> Index Scan using tprt1_idx on tprt_1 (actual rows=2.00 loops=5)
|
-> Index Scan using tprt1_idx on tprt_1 (actual rows=2.00 loops=5)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 5
|
|
||||||
-> Index Scan using tprt2_idx on tprt_2 (actual rows=2.75 loops=4)
|
-> Index Scan using tprt2_idx on tprt_2 (actual rows=2.75 loops=4)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 4
|
|
||||||
-> Index Scan using tprt3_idx on tprt_3 (actual rows=1.00 loops=2)
|
-> Index Scan using tprt3_idx on tprt_3 (actual rows=1.00 loops=2)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 2
|
|
||||||
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
||||||
Index Cond: (col1 < tbl1.col1)
|
Index Cond: (col1 < tbl1.col1)
|
||||||
Index Searches: 0
|
(15 rows)
|
||||||
(21 rows)
|
|
||||||
|
|
||||||
explain (analyze, costs off, summary off, timing off, buffers off)
|
explain (analyze, costs off, summary off, timing off, buffers off)
|
||||||
select * from tbl1 inner join tprt on tbl1.col1 = tprt.col1;
|
select * from tbl1 inner join tprt on tbl1.col1 = tprt.col1;
|
||||||
@ -3120,23 +3077,17 @@ select * from tbl1 inner join tprt on tbl1.col1 = tprt.col1;
|
|||||||
-> Append (actual rows=0.60 loops=5)
|
-> Append (actual rows=0.60 loops=5)
|
||||||
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt2_idx on tprt_2 (actual rows=1.00 loops=2)
|
-> Index Scan using tprt2_idx on tprt_2 (actual rows=1.00 loops=2)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 2
|
|
||||||
-> Index Scan using tprt3_idx on tprt_3 (actual rows=0.33 loops=3)
|
-> Index Scan using tprt3_idx on tprt_3 (actual rows=0.33 loops=3)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 3
|
|
||||||
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
(15 rows)
|
||||||
(21 rows)
|
|
||||||
|
|
||||||
select tbl1.col1, tprt.col1 from tbl1
|
select tbl1.col1, tprt.col1 from tbl1
|
||||||
inner join tprt on tbl1.col1 > tprt.col1
|
inner join tprt on tbl1.col1 > tprt.col1
|
||||||
@ -3190,23 +3141,17 @@ select * from tbl1 join tprt on tbl1.col1 < tprt.col1;
|
|||||||
-> Append (actual rows=1.00 loops=1)
|
-> Append (actual rows=1.00 loops=1)
|
||||||
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
||||||
Index Cond: (col1 > tbl1.col1)
|
Index Cond: (col1 > tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt2_idx on tprt_2 (never executed)
|
-> Index Scan using tprt2_idx on tprt_2 (never executed)
|
||||||
Index Cond: (col1 > tbl1.col1)
|
Index Cond: (col1 > tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
||||||
Index Cond: (col1 > tbl1.col1)
|
Index Cond: (col1 > tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
||||||
Index Cond: (col1 > tbl1.col1)
|
Index Cond: (col1 > tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
||||||
Index Cond: (col1 > tbl1.col1)
|
Index Cond: (col1 > tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt6_idx on tprt_6 (actual rows=1.00 loops=1)
|
-> Index Scan using tprt6_idx on tprt_6 (actual rows=1.00 loops=1)
|
||||||
Index Cond: (col1 > tbl1.col1)
|
Index Cond: (col1 > tbl1.col1)
|
||||||
Index Searches: 1
|
(15 rows)
|
||||||
(21 rows)
|
|
||||||
|
|
||||||
select tbl1.col1, tprt.col1 from tbl1
|
select tbl1.col1, tprt.col1 from tbl1
|
||||||
inner join tprt on tbl1.col1 < tprt.col1
|
inner join tprt on tbl1.col1 < tprt.col1
|
||||||
@ -3228,23 +3173,17 @@ select * from tbl1 join tprt on tbl1.col1 = tprt.col1;
|
|||||||
-> Append (actual rows=0.00 loops=1)
|
-> Append (actual rows=0.00 loops=1)
|
||||||
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
-> Index Scan using tprt1_idx on tprt_1 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt2_idx on tprt_2 (never executed)
|
-> Index Scan using tprt2_idx on tprt_2 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
-> Index Scan using tprt3_idx on tprt_3 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
-> Index Scan using tprt4_idx on tprt_4 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
-> Index Scan using tprt5_idx on tprt_5 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
-> Index Scan using tprt6_idx on tprt_6 (never executed)
|
||||||
Index Cond: (col1 = tbl1.col1)
|
Index Cond: (col1 = tbl1.col1)
|
||||||
Index Searches: 0
|
(15 rows)
|
||||||
(21 rows)
|
|
||||||
|
|
||||||
select tbl1.col1, tprt.col1 from tbl1
|
select tbl1.col1, tprt.col1 from tbl1
|
||||||
inner join tprt on tbl1.col1 = tprt.col1
|
inner join tprt on tbl1.col1 = tprt.col1
|
||||||
@ -3574,12 +3513,10 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1
|
|||||||
-> Index Scan using ma_test_p2_b_idx on ma_test_p2 ma_test_1 (actual rows=1.00 loops=1)
|
-> Index Scan using ma_test_p2_b_idx on ma_test_p2 ma_test_1 (actual rows=1.00 loops=1)
|
||||||
Filter: ((a >= $1) AND ((a % 10) = 5))
|
Filter: ((a >= $1) AND ((a % 10) = 5))
|
||||||
Rows Removed by Filter: 9
|
Rows Removed by Filter: 9
|
||||||
Index Searches: 1
|
|
||||||
-> Index Scan using ma_test_p3_b_idx on ma_test_p3 ma_test_2 (actual rows=1.00 loops=1)
|
-> Index Scan using ma_test_p3_b_idx on ma_test_p3 ma_test_2 (actual rows=1.00 loops=1)
|
||||||
Filter: ((a >= $1) AND ((a % 10) = 5))
|
Filter: ((a >= $1) AND ((a % 10) = 5))
|
||||||
Rows Removed by Filter: 9
|
Rows Removed by Filter: 9
|
||||||
Index Searches: 1
|
(9 rows)
|
||||||
(11 rows)
|
|
||||||
|
|
||||||
execute mt_q1(15);
|
execute mt_q1(15);
|
||||||
a
|
a
|
||||||
@ -3597,8 +3534,7 @@ explain (analyze, costs off, summary off, timing off, buffers off) execute mt_q1
|
|||||||
-> Index Scan using ma_test_p3_b_idx on ma_test_p3 ma_test_1 (actual rows=1.00 loops=1)
|
-> Index Scan using ma_test_p3_b_idx on ma_test_p3 ma_test_1 (actual rows=1.00 loops=1)
|
||||||
Filter: ((a >= $1) AND ((a % 10) = 5))
|
Filter: ((a >= $1) AND ((a % 10) = 5))
|
||||||
Rows Removed by Filter: 9
|
Rows Removed by Filter: 9
|
||||||
Index Searches: 1
|
(6 rows)
|
||||||
(7 rows)
|
|
||||||
|
|
||||||
execute mt_q1(25);
|
execute mt_q1(25);
|
||||||
a
|
a
|
||||||
@ -3646,17 +3582,13 @@ explain (analyze, costs off, summary off, timing off, buffers off) select * from
|
|||||||
-> Limit (actual rows=1.00 loops=1)
|
-> Limit (actual rows=1.00 loops=1)
|
||||||
-> Index Scan using ma_test_p2_b_idx on ma_test_p2 (actual rows=1.00 loops=1)
|
-> Index Scan using ma_test_p2_b_idx on ma_test_p2 (actual rows=1.00 loops=1)
|
||||||
Index Cond: (b IS NOT NULL)
|
Index Cond: (b IS NOT NULL)
|
||||||
Index Searches: 1
|
|
||||||
-> Index Scan using ma_test_p1_b_idx on ma_test_p1 ma_test_1 (never executed)
|
-> Index Scan using ma_test_p1_b_idx on ma_test_p1 ma_test_1 (never executed)
|
||||||
Filter: (a >= (InitPlan 2).col1)
|
Filter: (a >= (InitPlan 2).col1)
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using ma_test_p2_b_idx on ma_test_p2 ma_test_2 (actual rows=10.00 loops=1)
|
-> Index Scan using ma_test_p2_b_idx on ma_test_p2 ma_test_2 (actual rows=10.00 loops=1)
|
||||||
Filter: (a >= (InitPlan 2).col1)
|
Filter: (a >= (InitPlan 2).col1)
|
||||||
Index Searches: 1
|
|
||||||
-> Index Scan using ma_test_p3_b_idx on ma_test_p3 ma_test_3 (actual rows=10.00 loops=1)
|
-> Index Scan using ma_test_p3_b_idx on ma_test_p3 ma_test_3 (actual rows=10.00 loops=1)
|
||||||
Filter: (a >= (InitPlan 2).col1)
|
Filter: (a >= (InitPlan 2).col1)
|
||||||
Index Searches: 1
|
(14 rows)
|
||||||
(18 rows)
|
|
||||||
|
|
||||||
reset enable_seqscan;
|
reset enable_seqscan;
|
||||||
reset enable_sort;
|
reset enable_sort;
|
||||||
@ -4227,17 +4159,13 @@ select * from rangep where b IN((select 1),(select 2)) order by a;
|
|||||||
Sort Key: rangep_2.a
|
Sort Key: rangep_2.a
|
||||||
-> Index Scan using rangep_0_to_100_1_a_idx on rangep_0_to_100_1 rangep_2 (actual rows=0.00 loops=1)
|
-> Index Scan using rangep_0_to_100_1_a_idx on rangep_0_to_100_1 rangep_2 (actual rows=0.00 loops=1)
|
||||||
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
||||||
Index Searches: 1
|
|
||||||
-> Index Scan using rangep_0_to_100_2_a_idx on rangep_0_to_100_2 rangep_3 (actual rows=0.00 loops=1)
|
-> Index Scan using rangep_0_to_100_2_a_idx on rangep_0_to_100_2 rangep_3 (actual rows=0.00 loops=1)
|
||||||
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
||||||
Index Searches: 1
|
|
||||||
-> Index Scan using rangep_0_to_100_3_a_idx on rangep_0_to_100_3 rangep_4 (never executed)
|
-> Index Scan using rangep_0_to_100_3_a_idx on rangep_0_to_100_3 rangep_4 (never executed)
|
||||||
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
||||||
Index Searches: 0
|
|
||||||
-> Index Scan using rangep_100_to_200_a_idx on rangep_100_to_200 rangep_5 (actual rows=0.00 loops=1)
|
-> Index Scan using rangep_100_to_200_a_idx on rangep_100_to_200 rangep_5 (actual rows=0.00 loops=1)
|
||||||
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
Filter: (b = ANY (ARRAY[(InitPlan 1).col1, (InitPlan 2).col1]))
|
||||||
Index Searches: 1
|
(15 rows)
|
||||||
(19 rows)
|
|
||||||
|
|
||||||
reset enable_sort;
|
reset enable_sort;
|
||||||
drop table rangep;
|
drop table rangep;
|
||||||
|
@ -764,8 +764,7 @@ select * from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
|
|||||||
Index Scan using onek2_u2_prtl on onek2 (actual rows=1.00 loops=1)
|
Index Scan using onek2_u2_prtl on onek2 (actual rows=1.00 loops=1)
|
||||||
Index Cond: (unique2 = 11)
|
Index Cond: (unique2 = 11)
|
||||||
Filter: (stringu1 = 'ATAAAA'::name)
|
Filter: (stringu1 = 'ATAAAA'::name)
|
||||||
Index Searches: 1
|
(3 rows)
|
||||||
(4 rows)
|
|
||||||
|
|
||||||
explain (costs off)
|
explain (costs off)
|
||||||
select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
|
select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
|
||||||
|
@ -25,7 +25,6 @@ begin
|
|||||||
ln := regexp_replace(ln, 'Memory Usage: \d+', 'Memory Usage: N');
|
ln := regexp_replace(ln, 'Memory Usage: \d+', 'Memory Usage: N');
|
||||||
ln := regexp_replace(ln, 'Heap Fetches: \d+', 'Heap Fetches: N');
|
ln := regexp_replace(ln, 'Heap Fetches: \d+', 'Heap Fetches: N');
|
||||||
ln := regexp_replace(ln, 'loops=\d+', 'loops=N');
|
ln := regexp_replace(ln, 'loops=\d+', 'loops=N');
|
||||||
ln := regexp_replace(ln, 'Index Searches: \d+', 'Index Searches: N');
|
|
||||||
return next ln;
|
return next ln;
|
||||||
end loop;
|
end loop;
|
||||||
end;
|
end;
|
||||||
|
@ -588,10 +588,6 @@ begin
|
|||||||
ln := regexp_replace(ln, 'Workers Launched: \d+', 'Workers Launched: N');
|
ln := regexp_replace(ln, 'Workers Launched: \d+', 'Workers Launched: N');
|
||||||
ln := regexp_replace(ln, 'actual rows=\d+(?:\.\d+)? loops=\d+', 'actual rows=N loops=N');
|
ln := regexp_replace(ln, 'actual rows=\d+(?:\.\d+)? loops=\d+', 'actual rows=N loops=N');
|
||||||
ln := regexp_replace(ln, 'Rows Removed by Filter: \d+', 'Rows Removed by Filter: N');
|
ln := regexp_replace(ln, 'Rows Removed by Filter: \d+', 'Rows Removed by Filter: N');
|
||||||
perform regexp_matches(ln, 'Index Searches: \d+');
|
|
||||||
if found then
|
|
||||||
continue;
|
|
||||||
end if;
|
|
||||||
return next ln;
|
return next ln;
|
||||||
end loop;
|
end loop;
|
||||||
end;
|
end;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user