By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SELECT 1000000
| QUERY PLAN |
|---|
| Gather (cost=13298.80..25597.91 rows=4 width=4) (actual time=282.057..282.474 rows=0 loops=1) |
| Workers Planned: 2 |
| Workers Launched: 2 |
| Buffers: shared hit=491 read=10462 dirtied=5278 written=5182 |
| -> Parallel Hash Join (cost=12298.80..24597.51 rows=2 width=4) (actual time=267.402..267.404 rows=0 loops=3) |
| Hash Cond: (r1.e = r2.e) |
| Buffers: shared hit=491 read=10462 dirtied=5278 written=5182 |
| -> Parallel Seq Scan on tst_eav r1 (cost=0.00..12298.65 rows=12 width=4) (actual time=4.842..107.891 rows=32 loops=3) |
| Filter: ((a = 1) AND (v = 1)) |
| Rows Removed by Filter: 333301 |
| Buffers: shared hit=224 read=5182 |
| -> Parallel Hash (cost=12298.65..12298.65 rows=12 width=4) (actual time=154.311..154.311 rows=36 loops=3) |
| Buckets: 1024 Batches: 1 Memory Usage: 104kB |
| Buffers: shared hit=128 read=5278 dirtied=5278 written=5182 |
| -> Parallel Seq Scan on tst_eav r2 (cost=0.00..12298.65 rows=12 width=4) (actual time=4.397..154.106 rows=36 loops=3) |
| Filter: ((a = 2) AND (v = 2)) |
| Rows Removed by Filter: 333297 |
| Buffers: shared hit=128 read=5278 dirtied=5278 written=5182 |
| Planning Time: 0.333 ms |
| Execution Time: 282.519 ms |
EXPLAIN
| QUERY PLAN |
|---|
| HashSetOp Intersect (cost=1000.00..26603.88 rows=26 width=8) (actual time=232.875..232.982 rows=0 loops=1) |
| Buffers: shared hit=736 read=10076 |
| -> Append (cost=1000.00..26603.74 rows=56 width=8) (actual time=0.427..232.875 rows=204 loops=1) |
| Buffers: shared hit=736 read=10076 |
| -> Subquery Scan on "*SELECT* 1" (cost=1000.00..13301.73 rows=28 width=8) (actual time=0.426..115.895 rows=96 loops=1) |
| Buffers: shared hit=320 read=5086 |
| -> Gather (cost=1000.00..13301.45 rows=28 width=4) (actual time=0.425..115.873 rows=96 loops=1) |
| Workers Planned: 2 |
| Workers Launched: 2 |
| Buffers: shared hit=320 read=5086 |
| -> Parallel Seq Scan on tst_eav (cost=0.00..12298.65 rows=12 width=4) (actual time=0.390..100.050 rows=32 loops=3) |
| Filter: ((a = 1) AND (v = 1)) |
| Rows Removed by Filter: 333301 |
| Buffers: shared hit=320 read=5086 |
| -> Subquery Scan on "*SELECT* 2" (cost=1000.00..13301.73 rows=28 width=8) (actual time=1.064..116.943 rows=108 loops=1) |
| Buffers: shared hit=416 read=4990 |
| -> Gather (cost=1000.00..13301.45 rows=28 width=4) (actual time=1.063..116.917 rows=108 loops=1) |
| Workers Planned: 2 |
| Workers Launched: 2 |
| Buffers: shared hit=416 read=4990 |
| -> Parallel Seq Scan on tst_eav tst_eav_1 (cost=0.00..12298.65 rows=12 width=4) (actual time=0.968..95.715 rows=36 loops=3) |
| Filter: ((a = 2) AND (v = 2)) |
| Rows Removed by Filter: 333297 |
| Buffers: shared hit=416 read=4990 |
| Planning Time: 0.143 ms |
| Execution Time: 233.024 ms |
EXPLAIN
| QUERY PLAN |
|---|
| Finalize GroupAggregate (cost=15596.74..15603.29 rows=1 width=4) (actual time=147.821..149.403 rows=0 loops=1) |
| Group Key: e |
| Filter: (count(*) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=610 read=4894 |
| -> Gather Merge (cost=15596.74..15602.46 rows=46 width=12) (actual time=147.698..149.350 rows=204 loops=1) |
| Workers Planned: 2 |
| Workers Launched: 2 |
| Buffers: shared hit=610 read=4894 |
| -> Partial GroupAggregate (cost=14596.72..14597.12 rows=23 width=12) (actual time=133.173..133.202 rows=68 loops=3) |
| Group Key: e |
| Buffers: shared hit=610 read=4894 |
| -> Sort (cost=14596.72..14596.78 rows=23 width=4) (actual time=133.162..133.169 rows=68 loops=3) |
| Sort Key: e |
| Sort Method: quicksort Memory: 28kB |
| Worker 0: Sort Method: quicksort Memory: 28kB |
| Worker 1: Sort Method: quicksort Memory: 28kB |
| Buffers: shared hit=610 read=4894 |
| -> Parallel Seq Scan on tst_eav (cost=0.00..14596.20 rows=23 width=4) (actual time=0.719..132.994 rows=68 loops=3) |
| Filter: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Rows Removed by Filter: 333265 |
| Buffers: shared hit=512 read=4894 |
| Planning Time: 0.170 ms |
| Execution Time: 149.484 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=15603.29..15604.54 rows=1 width=4) (actual time=150.708..150.769 rows=0 loops=1) |
| Group Key: e |
| Filter: (array_length(array_agg(DISTINCT t.*), 1) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=570 read=4844 |
| -> Sort (cost=15603.29..15603.43 rows=55 width=40) (actual time=150.286..150.368 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 40kB |
| Buffers: shared hit=563 read=4843 |
| -> Gather (cost=1000.00..15601.70 rows=55 width=40) (actual time=0.511..150.242 rows=204 loops=1) |
| Workers Planned: 2 |
| Workers Launched: 2 |
| Buffers: shared hit=563 read=4843 |
| -> Parallel Seq Scan on tst_eav t (cost=0.00..14596.20 rows=23 width=40) (actual time=1.310..124.859 rows=68 loops=3) |
| Filter: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Rows Removed by Filter: 333265 |
| Buffers: shared hit=563 read=4843 |
| Planning Time: 0.123 ms |
| Execution Time: 150.834 ms |
EXPLAIN
CREATE INDEX
| QUERY PLAN |
|---|
| Hash Join (cost=104.95..200.38 rows=3 width=4) (actual time=2.111..2.113 rows=0 loops=1) |
| Hash Cond: (r1.e = r2.e) |
| Buffers: shared hit=27 read=184 |
| -> Bitmap Heap Scan on tst_eav r1 (cost=4.68..99.96 rows=25 width=4) (actual time=0.090..0.805 rows=96 loops=1) |
| Recheck Cond: ((a = 1) AND (v = 1)) |
| Heap Blocks: exact=96 |
| Buffers: shared hit=15 read=85 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.069..0.069 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared read=4 |
| -> Hash (cost=99.96..99.96 rows=25 width=4) (actual time=1.238..1.238 rows=108 loops=1) |
| Buckets: 1024 Batches: 1 Memory Usage: 12kB |
| Buffers: shared hit=12 read=99 |
| -> Bitmap Heap Scan on tst_eav r2 (cost=4.68..99.96 rows=25 width=4) (actual time=0.045..1.166 rows=108 loops=1) |
| Recheck Cond: ((a = 2) AND (v = 2)) |
| Heap Blocks: exact=107 |
| Buffers: shared hit=12 read=99 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.025..0.025 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=2 read=2 |
| Planning Time: 0.324 ms |
| Execution Time: 2.156 ms |
EXPLAIN
| QUERY PLAN |
|---|
| HashSetOp Intersect (cost=4.68..200.79 rows=24 width=8) (actual time=0.322..0.324 rows=0 loops=1) |
| Buffers: shared hit=211 |
| -> Append (cost=4.68..200.66 rows=50 width=8) (actual time=0.036..0.263 rows=204 loops=1) |
| Buffers: shared hit=211 |
| -> Subquery Scan on "*SELECT* 1" (cost=4.68..100.21 rows=25 width=8) (actual time=0.035..0.123 rows=96 loops=1) |
| Buffers: shared hit=100 |
| -> Bitmap Heap Scan on tst_eav (cost=4.68..99.96 rows=25 width=4) (actual time=0.034..0.111 rows=96 loops=1) |
| Recheck Cond: ((a = 1) AND (v = 1)) |
| Heap Blocks: exact=96 |
| Buffers: shared hit=100 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.019..0.019 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=4 |
| -> Subquery Scan on "*SELECT* 2" (cost=4.68..100.21 rows=25 width=8) (actual time=0.024..0.121 rows=108 loops=1) |
| Buffers: shared hit=111 |
| -> Bitmap Heap Scan on tst_eav tst_eav_1 (cost=4.68..99.96 rows=25 width=4) (actual time=0.024..0.109 rows=108 loops=1) |
| Recheck Cond: ((a = 2) AND (v = 2)) |
| Heap Blocks: exact=107 |
| Buffers: shared hit=111 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.013..0.013 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=4 |
| Planning Time: 0.124 ms |
| Execution Time: 0.370 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=197.36..198.29 rows=1 width=4) (actual time=0.266..0.267 rows=0 loops=1) |
| Group Key: e |
| Filter: (count(*) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=209 |
| -> Sort (cost=197.36..197.49 rows=50 width=4) (actual time=0.200..0.211 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 34kB |
| Buffers: shared hit=209 |
| -> Bitmap Heap Scan on tst_eav (cost=9.38..195.95 rows=50 width=4) (actual time=0.042..0.157 rows=204 loops=1) |
| Recheck Cond: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Heap Blocks: exact=201 |
| Buffers: shared hit=209 |
| -> BitmapOr (cost=9.38..9.38 rows=50 width=0) (actual time=0.023..0.024 rows=0 loops=1) |
| Buffers: shared hit=8 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.013..0.013 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=4 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.010..0.010 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=4 |
| Planning Time: 0.067 ms |
| Execution Time: 0.302 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=197.36..198.51 rows=1 width=4) (actual time=0.504..0.505 rows=0 loops=1) |
| Group Key: e |
| Filter: (array_length(array_agg(DISTINCT t.*), 1) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=209 |
| -> Sort (cost=197.36..197.49 rows=50 width=40) (actual time=0.229..0.245 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 40kB |
| Buffers: shared hit=209 |
| -> Bitmap Heap Scan on tst_eav t (cost=9.38..195.95 rows=50 width=40) (actual time=0.045..0.186 rows=204 loops=1) |
| Recheck Cond: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Heap Blocks: exact=201 |
| Buffers: shared hit=209 |
| -> BitmapOr (cost=9.38..9.38 rows=50 width=0) (actual time=0.023..0.023 rows=0 loops=1) |
| Buffers: shared hit=8 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.012..0.012 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=4 |
| -> Bitmap Index Scan on eav_idx1 (cost=0.00..4.67 rows=25 width=0) (actual time=0.010..0.010 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=4 |
| Planning Time: 0.059 ms |
| Execution Time: 0.536 ms |
EXPLAIN
DROP INDEX
CREATE INDEX
| QUERY PLAN |
|---|
| Hash Join (cost=104.95..200.38 rows=3 width=4) (actual time=0.294..0.295 rows=0 loops=1) |
| Hash Cond: (r1.e = r2.e) |
| Buffers: shared hit=205 read=4 |
| -> Bitmap Heap Scan on tst_eav r1 (cost=4.68..99.96 rows=25 width=4) (actual time=0.051..0.132 rows=96 loops=1) |
| Recheck Cond: ((a = 1) AND (v = 1)) |
| Heap Blocks: exact=96 |
| Buffers: shared hit=96 read=3 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.037..0.037 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared read=3 |
| -> Hash (cost=99.96..99.96 rows=25 width=4) (actual time=0.147..0.148 rows=108 loops=1) |
| Buckets: 1024 Batches: 1 Memory Usage: 12kB |
| Buffers: shared hit=109 read=1 |
| -> Bitmap Heap Scan on tst_eav r2 (cost=4.68..99.96 rows=25 width=4) (actual time=0.029..0.131 rows=108 loops=1) |
| Recheck Cond: ((a = 2) AND (v = 2)) |
| Heap Blocks: exact=107 |
| Buffers: shared hit=109 read=1 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.017..0.017 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=2 read=1 |
| Planning Time: 0.255 ms |
| Execution Time: 0.335 ms |
EXPLAIN
| QUERY PLAN |
|---|
| HashSetOp Intersect (cost=4.68..200.79 rows=24 width=8) (actual time=0.215..0.216 rows=0 loops=1) |
| Buffers: shared hit=209 |
| -> Append (cost=4.68..200.66 rows=50 width=8) (actual time=0.023..0.186 rows=204 loops=1) |
| Buffers: shared hit=209 |
| -> Subquery Scan on "*SELECT* 1" (cost=4.68..100.21 rows=25 width=8) (actual time=0.023..0.084 rows=96 loops=1) |
| Buffers: shared hit=99 |
| -> Bitmap Heap Scan on tst_eav (cost=4.68..99.96 rows=25 width=4) (actual time=0.021..0.073 rows=96 loops=1) |
| Recheck Cond: ((a = 1) AND (v = 1)) |
| Heap Blocks: exact=96 |
| Buffers: shared hit=99 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.011..0.011 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=3 |
| -> Subquery Scan on "*SELECT* 2" (cost=4.68..100.21 rows=25 width=8) (actual time=0.018..0.085 rows=108 loops=1) |
| Buffers: shared hit=110 |
| -> Bitmap Heap Scan on tst_eav tst_eav_1 (cost=4.68..99.96 rows=25 width=4) (actual time=0.018..0.074 rows=108 loops=1) |
| Recheck Cond: ((a = 2) AND (v = 2)) |
| Heap Blocks: exact=107 |
| Buffers: shared hit=110 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.009..0.009 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=3 |
| Planning Time: 0.081 ms |
| Execution Time: 0.248 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=197.36..198.29 rows=1 width=4) (actual time=0.240..0.241 rows=0 loops=1) |
| Group Key: e |
| Filter: (count(*) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=207 |
| -> Sort (cost=197.36..197.49 rows=50 width=4) (actual time=0.180..0.190 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 34kB |
| Buffers: shared hit=207 |
| -> Bitmap Heap Scan on tst_eav (cost=9.38..195.95 rows=50 width=4) (actual time=0.037..0.141 rows=204 loops=1) |
| Recheck Cond: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Heap Blocks: exact=201 |
| Buffers: shared hit=207 |
| -> BitmapOr (cost=9.38..9.38 rows=50 width=0) (actual time=0.020..0.021 rows=0 loops=1) |
| Buffers: shared hit=6 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.011..0.011 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=3 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.009..0.009 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=3 |
| Planning Time: 0.061 ms |
| Execution Time: 0.272 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=197.36..198.51 rows=1 width=4) (actual time=0.503..0.504 rows=0 loops=1) |
| Group Key: e |
| Filter: (array_length(array_agg(DISTINCT t.*), 1) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=207 |
| -> Sort (cost=197.36..197.49 rows=50 width=40) (actual time=0.229..0.244 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 40kB |
| Buffers: shared hit=207 |
| -> Bitmap Heap Scan on tst_eav t (cost=9.38..195.95 rows=50 width=40) (actual time=0.040..0.191 rows=204 loops=1) |
| Recheck Cond: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Heap Blocks: exact=201 |
| Buffers: shared hit=207 |
| -> BitmapOr (cost=9.38..9.38 rows=50 width=0) (actual time=0.020..0.020 rows=0 loops=1) |
| Buffers: shared hit=6 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.011..0.011 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=3 |
| -> Bitmap Index Scan on eav_idx2 (cost=0.00..4.67 rows=25 width=0) (actual time=0.009..0.009 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=3 |
| Planning Time: 0.053 ms |
| Execution Time: 0.532 ms |
EXPLAIN
DROP INDEX
CREATE INDEX
| QUERY PLAN |
|---|
| Hash Join (cost=104.95..200.38 rows=3 width=4) (actual time=0.327..0.328 rows=0 loops=1) |
| Hash Cond: (r1.e = r2.e) |
| Buffers: shared hit=205 read=4 |
| -> Bitmap Heap Scan on tst_eav r1 (cost=4.68..99.96 rows=25 width=4) (actual time=0.047..0.159 rows=96 loops=1) |
| Recheck Cond: ((a = 1) AND (v = 1)) |
| Heap Blocks: exact=96 |
| Buffers: shared hit=96 read=3 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.034..0.035 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared read=3 |
| -> Hash (cost=99.96..99.96 rows=25 width=4) (actual time=0.141..0.142 rows=108 loops=1) |
| Buckets: 1024 Batches: 1 Memory Usage: 12kB |
| Buffers: shared hit=109 read=1 |
| -> Bitmap Heap Scan on tst_eav r2 (cost=4.68..99.96 rows=25 width=4) (actual time=0.027..0.126 rows=108 loops=1) |
| Recheck Cond: ((a = 2) AND (v = 2)) |
| Heap Blocks: exact=107 |
| Buffers: shared hit=109 read=1 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.016..0.016 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=2 read=1 |
| Planning Time: 0.297 ms |
| Execution Time: 0.367 ms |
EXPLAIN
| QUERY PLAN |
|---|
| HashSetOp Intersect (cost=4.68..200.79 rows=24 width=8) (actual time=0.215..0.216 rows=0 loops=1) |
| Buffers: shared hit=209 |
| -> Append (cost=4.68..200.66 rows=50 width=8) (actual time=0.023..0.186 rows=204 loops=1) |
| Buffers: shared hit=209 |
| -> Subquery Scan on "*SELECT* 1" (cost=4.68..100.21 rows=25 width=8) (actual time=0.023..0.084 rows=96 loops=1) |
| Buffers: shared hit=99 |
| -> Bitmap Heap Scan on tst_eav (cost=4.68..99.96 rows=25 width=4) (actual time=0.021..0.073 rows=96 loops=1) |
| Recheck Cond: ((a = 1) AND (v = 1)) |
| Heap Blocks: exact=96 |
| Buffers: shared hit=99 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.011..0.011 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=3 |
| -> Subquery Scan on "*SELECT* 2" (cost=4.68..100.21 rows=25 width=8) (actual time=0.018..0.084 rows=108 loops=1) |
| Buffers: shared hit=110 |
| -> Bitmap Heap Scan on tst_eav tst_eav_1 (cost=4.68..99.96 rows=25 width=4) (actual time=0.018..0.074 rows=108 loops=1) |
| Recheck Cond: ((a = 2) AND (v = 2)) |
| Heap Blocks: exact=107 |
| Buffers: shared hit=110 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.009..0.009 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=3 |
| Planning Time: 0.081 ms |
| Execution Time: 0.248 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=197.36..198.29 rows=1 width=4) (actual time=0.241..0.242 rows=0 loops=1) |
| Group Key: e |
| Filter: (count(*) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=207 |
| -> Sort (cost=197.36..197.49 rows=50 width=4) (actual time=0.181..0.190 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 34kB |
| Buffers: shared hit=207 |
| -> Bitmap Heap Scan on tst_eav (cost=9.38..195.95 rows=50 width=4) (actual time=0.038..0.142 rows=204 loops=1) |
| Recheck Cond: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Heap Blocks: exact=201 |
| Buffers: shared hit=207 |
| -> BitmapOr (cost=9.38..9.38 rows=50 width=0) (actual time=0.020..0.021 rows=0 loops=1) |
| Buffers: shared hit=6 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.011..0.011 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=3 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.009..0.009 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=3 |
| Planning Time: 0.062 ms |
| Execution Time: 0.272 ms |
EXPLAIN
| QUERY PLAN |
|---|
| GroupAggregate (cost=197.36..198.51 rows=1 width=4) (actual time=0.482..0.483 rows=0 loops=1) |
| Group Key: e |
| Filter: (array_length(array_agg(DISTINCT t.*), 1) = 2) |
| Rows Removed by Filter: 204 |
| Buffers: shared hit=207 |
| -> Sort (cost=197.36..197.49 rows=50 width=40) (actual time=0.207..0.221 rows=204 loops=1) |
| Sort Key: e |
| Sort Method: quicksort Memory: 40kB |
| Buffers: shared hit=207 |
| -> Bitmap Heap Scan on tst_eav t (cost=9.38..195.95 rows=50 width=40) (actual time=0.041..0.169 rows=204 loops=1) |
| Recheck Cond: (((a = 1) AND (v = 1)) OR ((a = 2) AND (v = 2))) |
| Heap Blocks: exact=201 |
| Buffers: shared hit=207 |
| -> BitmapOr (cost=9.38..9.38 rows=50 width=0) (actual time=0.021..0.021 rows=0 loops=1) |
| Buffers: shared hit=6 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.011..0.011 rows=96 loops=1) |
| Index Cond: ((a = 1) AND (v = 1)) |
| Buffers: shared hit=3 |
| -> Bitmap Index Scan on eav_idx3 (cost=0.00..4.67 rows=25 width=0) (actual time=0.009..0.009 rows=108 loops=1) |
| Index Cond: ((a = 2) AND (v = 2)) |
| Buffers: shared hit=3 |
| Planning Time: 0.054 ms |
| Execution Time: 0.512 ms |
EXPLAIN