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 🙂