AlexTatiyants / pev

Postgres Explain Visualizer
MIT License
2.77k stars 194 forks source link

Query duration not displayed #24

Closed ohadle closed 7 years ago

ohadle commented 7 years ago

I submitted the results of EXPLAIN ANALYZE, but execution metrics (duration etc.) aren't displayed.

Output: http://tatiyants.com/pev/#/plans/plan_1485770094031

Submitted data:

[
  {
    "Execution Time": 26437.699,
    "Planning Time": 19.596,
    "Plan": {
      "Plans": [
        {
          "Plans": [
            {
              "Rows Removed by Join Filter": 3,
              "Plans": [
                {
                  "Plans": [
                    {
                      "Scan Direction": "Forward",
                      "Heap Fetches": 0,
                      "Node Type": "Index Only Scan",
                      "Relation Name": "cell_lte",
                      "Alias": "cell_lte_1",
                      "Actual Rows": 18,
                      "Parent Relationship": "Outer",
                      "Actual Loops": 1,
                      "Index Name": "lte_cell_id_modified_on"
                    }
                  ],
                  "Node Type": "Aggregate",
                  "Strategy": "Sorted",
                  "Actual Rows": 6,
                  "Parent Relationship": "Outer",
                  "Group Key": [
                    "cell_lte_1.id"
                  ],
                  "Actual Loops": 1
                },
                {
                  "Plans": [
                    {
                      "Plans": [
                        {
                          "Plans": [
                            {
                              "Parent Relationship": "Outer",
                              "Plans": [
                                {
                                  "Plans": [
                                    {
                                      "Plans": [
                                        {
                                          "Scan Direction": "Forward",
                                          "Heap Fetches": 0,
                                          "Node Type": "Index Only Scan",
                                          "Relation Name": "cell_lte",
                                          "Alias": "cell_lte_3",
                                          "Actual Rows": 13,
                                          "Parent Relationship": "Outer",
                                          "Actual Loops": 1,
                                          "Index Name": "lte_cell_id_modified_on"
                                        }
                                      ],
                                      "Node Type": "Aggregate",
                                      "Strategy": "Sorted",
                                      "Actual Rows": 5,
                                      "Parent Relationship": "Outer",
                                      "Group Key": [
                                        "cell_lte_3.id"
                                      ],
                                      "Actual Loops": 1
                                    },
                                    {
                                      "Hash Buckets": 131072,
                                      "Plans": [
                                        {
                                          "Filter": "(market = 'ILWI'::text)",
                                          "Node Type": "Seq Scan",
                                          "Relation Name": "cell_lte",
                                          "Alias": "cell_lte_2",
                                          "Actual Rows": 86116,
                                          "Parent Relationship": "Outer",
                                          "Rows Removed by Filter": 269630,
                                          "Actual Loops": 1
                                        }
                                      ],
                                      "Original Hash Buckets": 131072,
                                      "Hash Batches": 1,
                                      "Node Type": "Hash",
                                      "Actual Rows": 86116,
                                      "Parent Relationship": "Inner",
                                      "Peak Memory Usage": 6836,
                                      "Original Hash Batches": 1,
                                      "Actual Loops": 1
                                    }
                                  ],
                                  "Node Type": "Hash Join",
                                  "Join Type": "Inner",
                                  "Actual Rows": 2,
                                  "Parent Relationship": "Outer",
                                  "Hash Cond": "((cell_lte_3.id = cell_lte_2.id) AND ((max(cell_lte_3.modified_on)) = cell_lte_2.modified_on))",
                                  "Actual Loops": 1
                                }
                              ],
                              "Node Type": "Limit",
                              "Actual Rows": 2,
                              "Actual Loops": 1
                            }
                          ],
                          "Node Type": "Aggregate",
                          "Strategy": "Hashed",
                          "Actual Rows": 2,
                          "Parent Relationship": "Outer",
                          "Group Key": [
                            "cell_lte_2.id"
                          ],
                          "Actual Loops": 1
                        },
                        {
                          "Scan Direction": "Forward",
                          "Rows Removed by Index Recheck": 0,
                          "Heap Fetches": 0,
                          "Node Type": "Index Only Scan",
                          "Index Cond": "(id = cell_lte_2.id)",
                          "Relation Name": "cell_lte",
                          "Alias": "cell_lte",
                          "Actual Rows": 2,
                          "Parent Relationship": "Inner",
                          "Actual Loops": 2,
                          "Index Name": "lte_cell_id_modified_on"
                        }
                      ],
                      "Node Type": "Nested Loop",
                      "Join Type": "Inner",
                      "Actual Rows": 5,
                      "Parent Relationship": "Outer",
                      "Actual Loops": 1
                    }
                  ],
                  "Sort Space Type": "Memory",
                  "Sort Key": [
                    "cell_lte.id"
                  ],
                  "Node Type": "Sort",
                  "Sort Space Used": 25,
                  "Sort Method": "quicksort",
                  "Actual Rows": 5,
                  "Parent Relationship": "Inner",
                  "Actual Loops": 1
                }
              ],
              "Node Type": "Merge Join",
              "Join Type": "Inner",
              "Actual Rows": 2,
              "Parent Relationship": "Outer",
              "Join Filter": "(cell_lte.modified_on = (max(cell_lte_1.modified_on)))",
              "Merge Cond": "(cell_lte_1.id = cell_lte.id)",
              "Actual Loops": 1
            },
            {
              "Scan Direction": "Forward",
              "Rows Removed by Index Recheck": 0,
              "Node Type": "Index Scan",
              "Index Cond": "(cell_id = cell_lte.id)",
              "Relation Name": "pm_lte_cell",
              "Alias": "p",
              "Actual Rows": 2241,
              "Parent Relationship": "Inner",
              "Actual Loops": 2,
              "Index Name": "lte_start_time_cell_id"
            }
          ],
          "Node Type": "Nested Loop",
          "Join Type": "Inner",
          "Actual Rows": 4482,
          "Parent Relationship": "Outer",
          "Actual Loops": 1
        }
      ],
      "Sort Space Type": "Memory",
      "Sort Key": [
        "p.cell_id",
        "p.start_time"
      ],
      "Node Type": "Sort",
      "Sort Space Used": 543,
      "Sort Method": "quicksort",
      "Actual Rows": 4482,
      "Actual Loops": 1
    },
    "Triggers": []
  }
]
AlexTatiyants commented 7 years ago

Nodes of your plan are missing key properties required for these calculations (like "Actual Total Time" and "Total Cost"). Please make sure to use the full string suggested by Pev to generate the plan: EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)

ohadle commented 7 years ago

Works, thanks!