Changes on explain.depesz.com

I just released new version of Pg::Explain Perl library that is handling parsing of plans for explain.depesz.com.

There are quite a lot of changes, but mostly internal, but one thing is pretty interesting – Pg::Explain, and because of this also explain.depesz.com should be able to parse plans with arbitrary values of border, linestyle, format, unicode_border_linestyle, unicode_column_linestyle, and unicode_header_linestyle psql options.

You can see five simple examples already uploaded:

  • Plan on site
    ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │                                                  QUERY PLAN                                                  │
    ╞══════════════════════════════════════════════════════════════════════════════════════════════════════════════╡
    │ Nested Loop  (cost=0.00..2017.80 ROWS=15 width=133) (actual TIME=0.040..2.205 ROWS=15 loops=1)               │
    │   ->  Seq Scan ON users u  (cost=0.00..41.40 ROWS=1 width=129) (actual TIME=0.013..0.077 ROWS=1 loops=1)     │
    │         FILTER: (username = 'depesz'::text)                                                                  │
    │         ROWS Removed BY FILTER: 1231                                                                         │
    │   ->  Seq Scan ON part_0 p  (cost=0.00..1976.25 ROWS=15 width=17) (actual TIME=0.026..2.126 ROWS=15 loops=1) │
    │         FILTER: (added_by = 'depesz'::text)                                                                  │
    │         ROWS Removed BY FILTER: 13205                                                                        │
    │ Planning TIME: 0.042 ms                                                                                      │
    │ Execution TIME: 2.214 ms                                                                                     │
    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
    (9 ROWS)
  • Plan on site
    ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
    │                                                  QUERY PLAN                                                  │
    ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
    │ Nested Loop  (cost=0.00..2017.80 ROWS=15 width=133) (actual TIME=0.042..2.759 ROWS=15 loops=1)               │
    │   ->  Seq Scan ON users u  (cost=0.00..41.40 ROWS=1 width=129) (actual TIME=0.014..0.079 ROWS=1 loops=1)     │
    │         FILTER: (username = 'depesz'::text)                                                                  │
    │         ROWS Removed BY FILTER: 1231                                                                         │
    │   ->  Seq Scan ON part_0 p  (cost=0.00..1976.25 ROWS=15 width=17) (actual TIME=0.027..2.678 ROWS=15 loops=1) │
    │         FILTER: (added_by = 'depesz'::text)                                                                  │
    │         ROWS Removed BY FILTER: 13205                                                                        │
    │ Planning TIME: 0.050 ms                                                                                      │
    │ Execution TIME: 2.768 ms                                                                                     │
    └──────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
    (9 ROWS)
  • Plan on site
    +--------------------------------------------------------------------------------------------------------------+
    |                                                  QUERY PLAN                                                  |
    +--------------------------------------------------------------------------------------------------------------+
    | Nested Loop  (cost=0.00..2017.80 ROWS=15 width=133) (actual TIME=0.046..1.915 ROWS=15 loops=1)               |
    |   ->  Seq Scan ON users u  (cost=0.00..41.40 ROWS=1 width=129) (actual TIME=0.020..0.082 ROWS=1 loops=1)     |
    |         FILTER: (username = 'depesz'::text)                                                                  |
    |         ROWS Removed BY FILTER: 1231                                                                         |
    |   ->  Seq Scan ON part_0 p  (cost=0.00..1976.25 ROWS=15 width=17) (actual TIME=0.025..1.830 ROWS=15 loops=1) |
    |         FILTER: (added_by = 'depesz'::text)                                                                  |
    |         ROWS Removed BY FILTER: 13205                                                                        |
    | Planning TIME: 0.055 ms                                                                                      |
    | Execution TIME: 1.925 ms                                                                                     |
    +--------------------------------------------------------------------------------------------------------------+
    (9 ROWS)
  • Plan on site
    ╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
    ║                                                  QUERY PLAN                                                  ║
    ╟──────────────────────────────────────────────────────────────────────────────────────────────────────────────╢
    ║ Nested Loop  (cost=0.00..2017.80 ROWS=15 width=133) (actual TIME=0.037..2.018 ROWS=15 loops=1)               ║
    ║   ->  Seq Scan ON users u  (cost=0.00..41.40 ROWS=1 width=129) (actual TIME=0.013..0.078 ROWS=1 loops=1)     ║
    ║         FILTER: (username = 'depesz'::text)                                                                  ║
    ║         ROWS Removed BY FILTER: 1231                                                                         ║
    ║   ->  Seq Scan ON part_0 p  (cost=0.00..1976.25 ROWS=15 width=17) (actual TIME=0.023..1.938 ROWS=15 loops=1) ║
    ║         FILTER: (added_by = 'depesz'::text)                                                                  ║
    ║         ROWS Removed BY FILTER: 13205                                                                        ║
    ║ Planning TIME: 0.041 ms                                                                                      ║
    ║ Execution TIME: 2.027 ms                                                                                     ║
    ╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
    (9 ROWS)
  • Plan on site
    ╔══════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
    ║                                                  QUERY PLAN                                                  ║
    ╠══════════════════════════════════════════════════════════════════════════════════════════════════════════════╣
    ║ Nested Loop  (cost=0.00..2017.80 ROWS=15 width=133) (actual TIME=0.035..2.219 ROWS=15 loops=1)               ║
    ║   ->  Seq Scan ON users u  (cost=0.00..41.40 ROWS=1 width=129) (actual TIME=0.013..0.091 ROWS=1 loops=1)     ║
    ║         FILTER: (username = 'depesz'::text)                                                                  ║
    ║         ROWS Removed BY FILTER: 1231                                                                         ║
    ║   ->  Seq Scan ON part_0 p  (cost=0.00..1976.25 ROWS=15 width=17) (actual TIME=0.021..2.125 ROWS=15 loops=1) ║
    ║         FILTER: (added_by = 'depesz'::text)                                                                  ║
    ║         ROWS Removed BY FILTER: 13205                                                                        ║
    ║ Planning TIME: 0.040 ms                                                                                      ║
    ║ Execution TIME: 2.228 ms                                                                                     ║
    ╚══════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
    (9 ROWS)

Hope it will help some of you 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.