add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
12 rows affected
100000 rows affected
100000 rows affected
100000 rows affected
avg
165.0074000000000000
avg
75.9999700000000000
avg
39.9999700000000000
QUERY PLAN
Hash Join (actual rows=100000 loops=1)
  Hash Cond: (s.zc = zc.zodiac_id)
  -> Hash Join (actual rows=100000 loops=1)
        Hash Cond: (s.zb = zb.zodiac_id)
        -> Hash Join (actual rows=100000 loops=1)
              Hash Cond: (s.za = za.zodiac_id)
              -> Hash Join (actual rows=100000 loops=1)
                    Hash Cond: (s.z9 = z9.zodiac_id)
                    -> Hash Join (actual rows=100000 loops=1)
                          Hash Cond: (s.z8 = z8.zodiac_id)
                          -> Hash Join (actual rows=100000 loops=1)
                                Hash Cond: (s.z7 = z7.zodiac_id)
                                -> Hash Join (actual rows=100000 loops=1)
                                      Hash Cond: (s.z6 = z6.zodiac_id)
                                      -> Hash Join (actual rows=100000 loops=1)
                                            Hash Cond: (s.z5 = z5.zodiac_id)
                                            -> Hash Join (actual rows=100000 loops=1)
                                                  Hash Cond: (s.z4 = z4.zodiac_id)
                                                  -> Hash Join (actual rows=100000 loops=1)
                                                        Hash Cond: (s.z3 = z3.zodiac_id)
                                                        -> Hash Join (actual rows=100000 loops=1)
                                                              Hash Cond: (s.z2 = z2.zodiac_id)
                                                              -> Hash Join (actual rows=100000 loops=1)
                                                                    Hash Cond: (s.z1 = z1.zodiac_id)
                                                                    -> Seq Scan on t_surrogate s (actual rows=100000 loops=1)
                                                                    -> Hash (actual rows=12 loops=1)
                                                                          Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                                                          -> Seq Scan on zodiac z1 (actual rows=12 loops=1)
                                                              -> Hash (actual rows=12 loops=1)
                                                                    Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                                                    -> Seq Scan on zodiac z2 (actual rows=12 loops=1)
                                                        -> Hash (actual rows=12 loops=1)
                                                              Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                                              -> Seq Scan on zodiac z3 (actual rows=12 loops=1)
                                                  -> Hash (actual rows=12 loops=1)
                                                        Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                                        -> Seq Scan on zodiac z4 (actual rows=12 loops=1)
                                            -> Hash (actual rows=12 loops=1)
                                                  Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                                  -> Seq Scan on zodiac z5 (actual rows=12 loops=1)
                                      -> Hash (actual rows=12 loops=1)
                                            Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                            -> Seq Scan on zodiac z6 (actual rows=12 loops=1)
                                -> Hash (actual rows=12 loops=1)
                                      Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                      -> Seq Scan on zodiac z7 (actual rows=12 loops=1)
                          -> Hash (actual rows=12 loops=1)
                                Buckets: 1024 Batches: 1 Memory Usage: 9kB
                                -> Seq Scan on zodiac z8 (actual rows=12 loops=1)
                    -> Hash (actual rows=12 loops=1)
                          Buckets: 1024 Batches: 1 Memory Usage: 9kB
                          -> Seq Scan on zodiac z9 (actual rows=12 loops=1)
              -> Hash (actual rows=12 loops=1)
                    Buckets: 1024 Batches: 1 Memory Usage: 9kB
                    -> Seq Scan on zodiac za (actual rows=12 loops=1)
        -> Hash (actual rows=12 loops=1)
              Buckets: 1024 Batches: 1 Memory Usage: 9kB
              -> Seq Scan on zodiac zb (actual rows=12 loops=1)
  -> Hash (actual rows=12 loops=1)
        Buckets: 1024 Batches: 1 Memory Usage: 9kB
        -> Seq Scan on zodiac zc (actual rows=12 loops=1)
Planning Time: 3.829 ms
Execution Time: 274.220 ms
QUERY PLAN
Seq Scan on t_natural (actual rows=100000 loops=1)
Planning Time: 0.082 ms
Execution Time: 17.921 ms
QUERY PLAN
Seq Scan on t_enum (actual rows=100000 loops=1)
Planning Time: 0.059 ms
Execution Time: 7.988 ms