{
  "Plan": {
    "Node Type": "Limit",
    "Parallel Aware": false,
    "Async Capable": false,
    "Startup Cost": 16902.25,
    "Total Cost": 16998.47,
    "Plan Rows": 14,
    "Plan Width": 266,
    "Actual Rows": 100,
    "Actual Loops": 1,
    "Shared Hit Blocks": 287,
    "Shared Read Blocks": 4307,
    "Shared Dirtied Blocks": 0,
    "Shared Written Blocks": 0,
    "Local Hit Blocks": 0,
    "Local Read Blocks": 0,
    "Local Dirtied Blocks": 0,
    "Local Written Blocks": 0,
    "Temp Read Blocks": 11389,
    "Temp Written Blocks": 7604,
    "Plans": [
      {
        "Node Type": "Unique",
        "Parent Relationship": "InitPlan",
        "Subplan Name": "CTE preferred",
        "Parallel Aware": false,
        "Async Capable": false,
        "Startup Cost": 11738.69,
        "Total Cost": 15300.62,
        "Plan Rows": 2873,
        "Plan Width": 1071,
        "Actual Rows": 28729,
        "Actual Loops": 1,
        "Shared Hit Blocks": 128,
        "Shared Read Blocks": 4201,
        "Shared Dirtied Blocks": 0,
        "Shared Written Blocks": 0,
        "Local Hit Blocks": 0,
        "Local Read Blocks": 0,
        "Local Dirtied Blocks": 0,
        "Local Written Blocks": 0,
        "Temp Read Blocks": 3805,
        "Temp Written Blocks": 3812,
        "Plans": [
          {
            "Node Type": "Gather Merge",
            "Parent Relationship": "Outer",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 11738.69,
            "Total Cost": 15085.12,
            "Plan Rows": 28733,
            "Plan Width": 1071,
            "Actual Rows": 28733,
            "Actual Loops": 1,
            "Workers Planned": 2,
            "Workers Launched": 2,
            "Shared Hit Blocks": 128,
            "Shared Read Blocks": 4201,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 3805,
            "Temp Written Blocks": 3812,
            "Plans": [
              {
                "Node Type": "Sort",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Startup Cost": 10738.67,
                "Total Cost": 10768.6,
                "Plan Rows": 11972,
                "Plan Width": 1071,
                "Actual Rows": 9578,
                "Actual Loops": 3,
                "Sort Key": [
                  "sec_financial_period.sec_company_id",
                  "sec_financial_period.fiscal_year",
                  "sec_financial_period.fiscal_quarter",
                  "sec_financial_period.filed_at DESC",
                  "sec_financial_period.revision DESC",
                  "sec_financial_period.accession_number DESC"
                ],
                "Sort Method": "external merge",
                "Sort Space Used": 7640,
                "Sort Space Type": "Disk",
                "Shared Hit Blocks": 128,
                "Shared Read Blocks": 4201,
                "Shared Dirtied Blocks": 0,
                "Shared Written Blocks": 0,
                "Local Hit Blocks": 0,
                "Local Read Blocks": 0,
                "Local Dirtied Blocks": 0,
                "Local Written Blocks": 0,
                "Temp Read Blocks": 3805,
                "Temp Written Blocks": 3812,
                "Workers": [
                  {
                    "Worker Number": 0,
                    "Sort Method": "external merge",
                    "Sort Space Used": 10376,
                    "Sort Space Type": "Disk"
                  },
                  {
                    "Worker Number": 1,
                    "Sort Method": "external merge",
                    "Sort Space Used": 12424,
                    "Sort Space Type": "Disk"
                  }
                ],
                "Plans": [
                  {
                    "Node Type": "Seq Scan",
                    "Parent Relationship": "Outer",
                    "Parallel Aware": true,
                    "Async Capable": false,
                    "Relation Name": "sec_financial_period",
                    "Alias": "sec_financial_period",
                    "Startup Cost": 0.0,
                    "Total Cost": 4320.72,
                    "Plan Rows": 11972,
                    "Plan Width": 1071,
                    "Actual Rows": 9578,
                    "Actual Loops": 3,
                    "Shared Hit Blocks": 0,
                    "Shared Read Blocks": 4201,
                    "Shared Dirtied Blocks": 0,
                    "Shared Written Blocks": 0,
                    "Local Hit Blocks": 0,
                    "Local Read Blocks": 0,
                    "Local Dirtied Blocks": 0,
                    "Local Written Blocks": 0,
                    "Temp Read Blocks": 0,
                    "Temp Written Blocks": 0,
                    "Workers": []
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "Node Type": "Result",
        "Parent Relationship": "Outer",
        "Parallel Aware": false,
        "Async Capable": false,
        "Startup Cost": 1601.63,
        "Total Cost": 1697.85,
        "Plan Rows": 14,
        "Plan Width": 266,
        "Actual Rows": 100,
        "Actual Loops": 1,
        "Shared Hit Blocks": 159,
        "Shared Read Blocks": 1160,
        "Shared Dirtied Blocks": 0,
        "Shared Written Blocks": 0,
        "Local Hit Blocks": 0,
        "Local Read Blocks": 0,
        "Local Dirtied Blocks": 0,
        "Local Written Blocks": 0,
        "Temp Read Blocks": 8539,
        "Temp Written Blocks": 4748,
        "Plans": [
          {
            "Node Type": "Sort",
            "Parent Relationship": "Outer",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 1601.63,
            "Total Cost": 1601.67,
            "Plan Rows": 14,
            "Plan Width": 262,
            "Actual Rows": 100,
            "Actual Loops": 1,
            "Sort Key": [
              "(CASE WHEN ((metrics.ttm_quarter_count = 4) AND ((((metrics.fiscal_year * 4) + metrics.fiscal_quarter) - metrics.ttm_start_index) = 3)) THEN metrics.ttm_revenue ELSE NULL::numeric END) DESC NULLS LAST",
              "c.ticker"
            ],
            "Sort Method": "top-N heapsort",
            "Sort Space Used": 66,
            "Sort Space Type": "Memory",
            "Shared Hit Blocks": 3,
            "Shared Read Blocks": 1094,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 8539,
            "Temp Written Blocks": 4748,
            "Plans": [
              {
                "Node Type": "WindowAgg",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Startup Cost": 1550.77,
                "Total Cost": 1601.36,
                "Plan Rows": 14,
                "Plan Width": 262,
                "Actual Rows": 695,
                "Actual Loops": 1,
                "Shared Hit Blocks": 0,
                "Shared Read Blocks": 1094,
                "Shared Dirtied Blocks": 0,
                "Shared Written Blocks": 0,
                "Local Hit Blocks": 0,
                "Local Read Blocks": 0,
                "Local Dirtied Blocks": 0,
                "Local Written Blocks": 0,
                "Temp Read Blocks": 8539,
                "Temp Written Blocks": 4748,
                "Plans": [
                  {
                    "Node Type": "Hash Join",
                    "Parent Relationship": "Outer",
                    "Parallel Aware": false,
                    "Async Capable": false,
                    "Join Type": "Inner",
                    "Startup Cost": 1550.77,
                    "Total Cost": 1600.98,
                    "Plan Rows": 14,
                    "Plan Width": 270,
                    "Actual Rows": 695,
                    "Actual Loops": 1,
                    "Inner Unique": false,
                    "Hash Cond": "(c.id = metrics.sec_company_id)",
                    "Shared Hit Blocks": 0,
                    "Shared Read Blocks": 1094,
                    "Shared Dirtied Blocks": 0,
                    "Shared Written Blocks": 0,
                    "Local Hit Blocks": 0,
                    "Local Read Blocks": 0,
                    "Local Dirtied Blocks": 0,
                    "Local Written Blocks": 0,
                    "Temp Read Blocks": 8539,
                    "Temp Written Blocks": 4748,
                    "Plans": [
                      {
                        "Node Type": "Seq Scan",
                        "Parent Relationship": "Outer",
                        "Parallel Aware": false,
                        "Async Capable": false,
                        "Relation Name": "sec_company",
                        "Alias": "c",
                        "Startup Cost": 0.0,
                        "Total Cost": 47.33,
                        "Plan Rows": 730,
                        "Plan Width": 62,
                        "Actual Rows": 730,
                        "Actual Loops": 1,
                        "Filter": "is_active",
                        "Rows Removed by Filter": 3,
                        "Shared Hit Blocks": 0,
                        "Shared Read Blocks": 40,
                        "Shared Dirtied Blocks": 0,
                        "Shared Written Blocks": 0,
                        "Local Hit Blocks": 0,
                        "Local Read Blocks": 0,
                        "Local Dirtied Blocks": 0,
                        "Local Written Blocks": 0,
                        "Temp Read Blocks": 0,
                        "Temp Written Blocks": 0
                      },
                      {
                        "Node Type": "Hash",
                        "Parent Relationship": "Inner",
                        "Parallel Aware": false,
                        "Async Capable": false,
                        "Startup Cost": 1550.6,
                        "Total Cost": 1550.6,
                        "Plan Rows": 14,
                        "Plan Width": 224,
                        "Actual Rows": 698,
                        "Actual Loops": 1,
                        "Hash Buckets": 1024,
                        "Original Hash Buckets": 1024,
                        "Hash Batches": 1,
                        "Original Hash Batches": 1,
                        "Peak Memory Usage": 100,
                        "Shared Hit Blocks": 0,
                        "Shared Read Blocks": 1054,
                        "Shared Dirtied Blocks": 0,
                        "Shared Written Blocks": 0,
                        "Local Hit Blocks": 0,
                        "Local Read Blocks": 0,
                        "Local Dirtied Blocks": 0,
                        "Local Written Blocks": 0,
                        "Temp Read Blocks": 8539,
                        "Temp Written Blocks": 4748,
                        "Plans": [
                          {
                            "Node Type": "Subquery Scan",
                            "Parent Relationship": "Outer",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Alias": "metrics",
                            "Startup Cost": 907.44,
                            "Total Cost": 1550.6,
                            "Plan Rows": 14,
                            "Plan Width": 224,
                            "Actual Rows": 698,
                            "Actual Loops": 1,
                            "Filter": "(metrics.latest_rank = 1)",
                            "Rows Removed by Filter": 0,
                            "Shared Hit Blocks": 0,
                            "Shared Read Blocks": 1054,
                            "Shared Dirtied Blocks": 0,
                            "Shared Written Blocks": 0,
                            "Local Hit Blocks": 0,
                            "Local Read Blocks": 0,
                            "Local Dirtied Blocks": 0,
                            "Local Written Blocks": 0,
                            "Temp Read Blocks": 8539,
                            "Temp Written Blocks": 4748,
                            "Plans": [
                              {
                                "Node Type": "WindowAgg",
                                "Parent Relationship": "Subquery",
                                "Parallel Aware": false,
                                "Async Capable": false,
                                "Startup Cost": 907.44,
                                "Total Cost": 1514.68,
                                "Plan Rows": 2873,
                                "Plan Width": 753,
                                "Actual Rows": 698,
                                "Actual Loops": 1,
                                "Filter": "((row_number() OVER (?)) <= 1)",
                                "Rows Removed by Filter": 28031,
                                "Shared Hit Blocks": 0,
                                "Shared Read Blocks": 1054,
                                "Shared Dirtied Blocks": 0,
                                "Shared Written Blocks": 0,
                                "Local Hit Blocks": 0,
                                "Local Read Blocks": 0,
                                "Local Dirtied Blocks": 0,
                                "Local Written Blocks": 0,
                                "Temp Read Blocks": 8539,
                                "Temp Written Blocks": 4748,
                                "Plans": [
                                  {
                                    "Node Type": "Incremental Sort",
                                    "Parent Relationship": "Outer",
                                    "Parallel Aware": false,
                                    "Async Capable": false,
                                    "Startup Cost": 907.44,
                                    "Total Cost": 1356.67,
                                    "Plan Rows": 2873,
                                    "Plan Width": 176,
                                    "Actual Rows": 28729,
                                    "Actual Loops": 1,
                                    "Sort Key": [
                                      "p.sec_company_id",
                                      "p.fiscal_year",
                                      "p.fiscal_quarter"
                                    ],
                                    "Presorted Key": [
                                      "p.sec_company_id"
                                    ],
                                    "Full-sort Groups": {
                                      "Group Count": 595,
                                      "Sort Methods Used": [
                                        "quicksort"
                                      ],
                                      "Sort Space Memory": {
                                        "Average Sort Space Used": 32,
                                        "Peak Sort Space Used": 32
                                      }
                                    },
                                    "Pre-sorted Groups": {
                                      "Group Count": 114,
                                      "Sort Methods Used": [
                                        "quicksort"
                                      ],
                                      "Sort Space Memory": {
                                        "Average Sort Space Used": 27,
                                        "Peak Sort Space Used": 27
                                      }
                                    },
                                    "Shared Hit Blocks": 0,
                                    "Shared Read Blocks": 1054,
                                    "Shared Dirtied Blocks": 0,
                                    "Shared Written Blocks": 0,
                                    "Local Hit Blocks": 0,
                                    "Local Read Blocks": 0,
                                    "Local Dirtied Blocks": 0,
                                    "Local Written Blocks": 0,
                                    "Temp Read Blocks": 8539,
                                    "Temp Written Blocks": 4748,
                                    "Plans": [
                                      {
                                        "Node Type": "WindowAgg",
                                        "Parent Relationship": "Outer",
                                        "Parallel Aware": false,
                                        "Async Capable": false,
                                        "Startup Cost": 905.4,
                                        "Total Cost": 1217.72,
                                        "Plan Rows": 2873,
                                        "Plan Width": 176,
                                        "Actual Rows": 28729,
                                        "Actual Loops": 1,
                                        "Run Condition": "(row_number() OVER (?) <= 1)",
                                        "Shared Hit Blocks": 0,
                                        "Shared Read Blocks": 1054,
                                        "Shared Dirtied Blocks": 0,
                                        "Shared Written Blocks": 0,
                                        "Local Hit Blocks": 0,
                                        "Local Read Blocks": 0,
                                        "Local Dirtied Blocks": 0,
                                        "Local Written Blocks": 0,
                                        "Temp Read Blocks": 8539,
                                        "Temp Written Blocks": 4748,
                                        "Plans": [
                                          {
                                            "Node Type": "Incremental Sort",
                                            "Parent Relationship": "Outer",
                                            "Parallel Aware": false,
                                            "Async Capable": false,
                                            "Startup Cost": 905.4,
                                            "Total Cost": 1160.26,
                                            "Plan Rows": 2873,
                                            "Plan Width": 168,
                                            "Actual Rows": 28729,
                                            "Actual Loops": 1,
                                            "Sort Key": [
                                              "p.sec_company_id",
                                              "p.fiscal_year DESC",
                                              "p.fiscal_quarter DESC"
                                            ],
                                            "Presorted Key": [
                                              "p.sec_company_id"
                                            ],
                                            "Full-sort Groups": {
                                              "Group Count": 595,
                                              "Sort Methods Used": [
                                                "quicksort"
                                              ],
                                              "Sort Space Memory": {
                                                "Average Sort Space Used": 32,
                                                "Peak Sort Space Used": 32
                                              }
                                            },
                                            "Pre-sorted Groups": {
                                              "Group Count": 114,
                                              "Sort Methods Used": [
                                                "quicksort"
                                              ],
                                              "Sort Space Memory": {
                                                "Average Sort Space Used": 27,
                                                "Peak Sort Space Used": 27
                                              }
                                            },
                                            "Shared Hit Blocks": 0,
                                            "Shared Read Blocks": 1054,
                                            "Shared Dirtied Blocks": 0,
                                            "Shared Written Blocks": 0,
                                            "Local Hit Blocks": 0,
                                            "Local Read Blocks": 0,
                                            "Local Dirtied Blocks": 0,
                                            "Local Written Blocks": 0,
                                            "Temp Read Blocks": 8539,
                                            "Temp Written Blocks": 4748,
                                            "Plans": [
                                              {
                                                "Node Type": "Merge Join",
                                                "Parent Relationship": "Outer",
                                                "Parallel Aware": false,
                                                "Async Capable": false,
                                                "Join Type": "Left",
                                                "Startup Cost": 904.34,
                                                "Total Cost": 1021.32,
                                                "Plan Rows": 2873,
                                                "Plan Width": 168,
                                                "Actual Rows": 28729,
                                                "Actual Loops": 1,
                                                "Inner Unique": false,
                                                "Merge Cond": "((p.sec_company_id = prev.sec_company_id) AND (((((p.fiscal_year * 4) + p.fiscal_quarter) - 1)) = (((prev.fiscal_year * 4) + prev.fiscal_quarter))))",
                                                "Shared Hit Blocks": 0,
                                                "Shared Read Blocks": 1054,
                                                "Shared Dirtied Blocks": 0,
                                                "Shared Written Blocks": 0,
                                                "Local Hit Blocks": 0,
                                                "Local Read Blocks": 0,
                                                "Local Dirtied Blocks": 0,
                                                "Local Written Blocks": 0,
                                                "Temp Read Blocks": 8539,
                                                "Temp Written Blocks": 4748,
                                                "Plans": [
                                                  {
                                                    "Node Type": "Sort",
                                                    "Parent Relationship": "Outer",
                                                    "Parallel Aware": false,
                                                    "Async Capable": false,
                                                    "Startup Cost": 681.85,
                                                    "Total Cost": 689.03,
                                                    "Plan Rows": 2873,
                                                    "Plan Width": 142,
                                                    "Actual Rows": 28729,
                                                    "Actual Loops": 1,
                                                    "Sort Key": [
                                                      "p.sec_company_id",
                                                      "((((p.fiscal_year * 4) + p.fiscal_quarter) - 1))"
                                                    ],
                                                    "Sort Method": "quicksort",
                                                    "Sort Space Used": 3720,
                                                    "Sort Space Type": "Memory",
                                                    "Shared Hit Blocks": 0,
                                                    "Shared Read Blocks": 1054,
                                                    "Shared Dirtied Blocks": 0,
                                                    "Shared Written Blocks": 0,
                                                    "Local Hit Blocks": 0,
                                                    "Local Read Blocks": 0,
                                                    "Local Dirtied Blocks": 0,
                                                    "Local Written Blocks": 0,
                                                    "Temp Read Blocks": 4747,
                                                    "Temp Written Blocks": 4748,
                                                    "Plans": [
                                                      {
                                                        "Node Type": "Merge Join",
                                                        "Parent Relationship": "Outer",
                                                        "Parallel Aware": false,
                                                        "Async Capable": false,
                                                        "Join Type": "Left",
                                                        "Startup Cost": 444.98,
                                                        "Total Cost": 516.82,
                                                        "Plan Rows": 2873,
                                                        "Plan Width": 142,
                                                        "Actual Rows": 28729,
                                                        "Actual Loops": 1,
                                                        "Inner Unique": false,
                                                        "Merge Cond": "((p.sec_company_id = yoy.sec_company_id) AND (((p.fiscal_year - 1)) = yoy.fiscal_year) AND (p.fiscal_quarter = yoy.fiscal_quarter))",
                                                        "Shared Hit Blocks": 0,
                                                        "Shared Read Blocks": 1054,
                                                        "Shared Dirtied Blocks": 0,
                                                        "Shared Written Blocks": 0,
                                                        "Local Hit Blocks": 0,
                                                        "Local Read Blocks": 0,
                                                        "Local Dirtied Blocks": 0,
                                                        "Local Written Blocks": 0,
                                                        "Temp Read Blocks": 4747,
                                                        "Temp Written Blocks": 4748,
                                                        "Plans": [
                                                          {
                                                            "Node Type": "Sort",
                                                            "Parent Relationship": "Outer",
                                                            "Parallel Aware": false,
                                                            "Async Capable": false,
                                                            "Startup Cost": 222.49,
                                                            "Total Cost": 229.67,
                                                            "Plan Rows": 2873,
                                                            "Plan Width": 116,
                                                            "Actual Rows": 28729,
                                                            "Actual Loops": 1,
                                                            "Sort Key": [
                                                              "p.sec_company_id",
                                                              "((p.fiscal_year - 1))",
                                                              "p.fiscal_quarter"
                                                            ],
                                                            "Sort Method": "quicksort",
                                                            "Sort Space Used": 3525,
                                                            "Sort Space Type": "Memory",
                                                            "Shared Hit Blocks": 0,
                                                            "Shared Read Blocks": 1054,
                                                            "Shared Dirtied Blocks": 0,
                                                            "Shared Written Blocks": 0,
                                                            "Local Hit Blocks": 0,
                                                            "Local Read Blocks": 0,
                                                            "Local Dirtied Blocks": 0,
                                                            "Local Written Blocks": 0,
                                                            "Temp Read Blocks": 955,
                                                            "Temp Written Blocks": 4747,
                                                            "Plans": [
                                                              {
                                                                "Node Type": "CTE Scan",
                                                                "Parent Relationship": "Outer",
                                                                "Parallel Aware": false,
                                                                "Async Capable": false,
                                                                "CTE Name": "preferred",
                                                                "Alias": "p",
                                                                "Startup Cost": 0.0,
                                                                "Total Cost": 57.46,
                                                                "Plan Rows": 2873,
                                                                "Plan Width": 116,
                                                                "Actual Rows": 28729,
                                                                "Actual Loops": 1,
                                                                "Shared Hit Blocks": 0,
                                                                "Shared Read Blocks": 1054,
                                                                "Shared Dirtied Blocks": 0,
                                                                "Shared Written Blocks": 0,
                                                                "Local Hit Blocks": 0,
                                                                "Local Read Blocks": 0,
                                                                "Local Dirtied Blocks": 0,
                                                                "Local Written Blocks": 0,
                                                                "Temp Read Blocks": 955,
                                                                "Temp Written Blocks": 4747
                                                              }
                                                            ]
                                                          },
                                                          {
                                                            "Node Type": "Sort",
                                                            "Parent Relationship": "Inner",
                                                            "Parallel Aware": false,
                                                            "Async Capable": false,
                                                            "Startup Cost": 222.49,
                                                            "Total Cost": 229.67,
                                                            "Plan Rows": 2873,
                                                            "Plan Width": 50,
                                                            "Actual Rows": 28726,
                                                            "Actual Loops": 1,
                                                            "Sort Key": [
                                                              "yoy.sec_company_id",
                                                              "yoy.fiscal_year",
                                                              "yoy.fiscal_quarter"
                                                            ],
                                                            "Sort Method": "quicksort",
                                                            "Sort Space Used": 2837,
                                                            "Sort Space Type": "Memory",
                                                            "Shared Hit Blocks": 0,
                                                            "Shared Read Blocks": 0,
                                                            "Shared Dirtied Blocks": 0,
                                                            "Shared Written Blocks": 0,
                                                            "Local Hit Blocks": 0,
                                                            "Local Read Blocks": 0,
                                                            "Local Dirtied Blocks": 0,
                                                            "Local Written Blocks": 0,
                                                            "Temp Read Blocks": 3792,
                                                            "Temp Written Blocks": 1,
                                                            "Plans": [
                                                              {
                                                                "Node Type": "CTE Scan",
                                                                "Parent Relationship": "Outer",
                                                                "Parallel Aware": false,
                                                                "Async Capable": false,
                                                                "CTE Name": "preferred",
                                                                "Alias": "yoy",
                                                                "Startup Cost": 0.0,
                                                                "Total Cost": 57.46,
                                                                "Plan Rows": 2873,
                                                                "Plan Width": 50,
                                                                "Actual Rows": 28729,
                                                                "Actual Loops": 1,
                                                                "Shared Hit Blocks": 0,
                                                                "Shared Read Blocks": 0,
                                                                "Shared Dirtied Blocks": 0,
                                                                "Shared Written Blocks": 0,
                                                                "Local Hit Blocks": 0,
                                                                "Local Read Blocks": 0,
                                                                "Local Dirtied Blocks": 0,
                                                                "Local Written Blocks": 0,
                                                                "Temp Read Blocks": 3792,
                                                                "Temp Written Blocks": 1
                                                              }
                                                            ]
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "Node Type": "Sort",
                                                    "Parent Relationship": "Inner",
                                                    "Parallel Aware": false,
                                                    "Async Capable": false,
                                                    "Startup Cost": 222.49,
                                                    "Total Cost": 229.67,
                                                    "Plan Rows": 2873,
                                                    "Plan Width": 50,
                                                    "Actual Rows": 28729,
                                                    "Actual Loops": 1,
                                                    "Sort Key": [
                                                      "prev.sec_company_id",
                                                      "(((prev.fiscal_year * 4) + prev.fiscal_quarter))"
                                                    ],
                                                    "Sort Method": "quicksort",
                                                    "Sort Space Used": 2996,
                                                    "Sort Space Type": "Memory",
                                                    "Shared Hit Blocks": 0,
                                                    "Shared Read Blocks": 0,
                                                    "Shared Dirtied Blocks": 0,
                                                    "Shared Written Blocks": 0,
                                                    "Local Hit Blocks": 0,
                                                    "Local Read Blocks": 0,
                                                    "Local Dirtied Blocks": 0,
                                                    "Local Written Blocks": 0,
                                                    "Temp Read Blocks": 3792,
                                                    "Temp Written Blocks": 0,
                                                    "Plans": [
                                                      {
                                                        "Node Type": "CTE Scan",
                                                        "Parent Relationship": "Outer",
                                                        "Parallel Aware": false,
                                                        "Async Capable": false,
                                                        "CTE Name": "preferred",
                                                        "Alias": "prev",
                                                        "Startup Cost": 0.0,
                                                        "Total Cost": 57.46,
                                                        "Plan Rows": 2873,
                                                        "Plan Width": 50,
                                                        "Actual Rows": 28729,
                                                        "Actual Loops": 1,
                                                        "Shared Hit Blocks": 0,
                                                        "Shared Read Blocks": 0,
                                                        "Shared Dirtied Blocks": 0,
                                                        "Shared Written Blocks": 0,
                                                        "Local Hit Blocks": 0,
                                                        "Local Read Blocks": 0,
                                                        "Local Dirtied Blocks": 0,
                                                        "Local Written Blocks": 0,
                                                        "Temp Read Blocks": 3792,
                                                        "Temp Written Blocks": 0
                                                      }
                                                    ]
                                                  }
                                                ]
                                              }
                                            ]
                                          }
                                        ]
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "Node Type": "Aggregate",
            "Strategy": "Plain",
            "Partial Mode": "Simple",
            "Parent Relationship": "SubPlan",
            "Subplan Name": "SubPlan 2",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 6.83,
            "Total Cost": 6.85,
            "Plan Rows": 1,
            "Plan Width": 4,
            "Actual Rows": 1,
            "Actual Loops": 100,
            "Shared Hit Blocks": 156,
            "Shared Read Blocks": 66,
            "Shared Dirtied Blocks": 0,
            "Shared Written Blocks": 0,
            "Local Hit Blocks": 0,
            "Local Read Blocks": 0,
            "Local Dirtied Blocks": 0,
            "Local Written Blocks": 0,
            "Temp Read Blocks": 0,
            "Temp Written Blocks": 0,
            "Plans": [
              {
                "Node Type": "Index Only Scan",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Scan Direction": "Forward",
                "Index Name": "sec_segment_fact_company_period_idx",
                "Relation Name": "sec_segment_fact",
                "Alias": "sf",
                "Startup Cost": 0.29,
                "Total Cost": 6.52,
                "Plan Rows": 127,
                "Plan Width": 0,
                "Actual Rows": 162,
                "Actual Loops": 100,
                "Index Cond": "(sec_company_id = c.id)",
                "Rows Removed by Index Recheck": 0,
                "Heap Fetches": 0,
                "Shared Hit Blocks": 156,
                "Shared Read Blocks": 66,
                "Shared Dirtied Blocks": 0,
                "Shared Written Blocks": 0,
                "Local Hit Blocks": 0,
                "Local Read Blocks": 0,
                "Local Dirtied Blocks": 0,
                "Local Written Blocks": 0,
                "Temp Read Blocks": 0,
                "Temp Written Blocks": 0
              }
            ]
          }
        ]
      }
    ]
  },
  "Settings": {},
  "Planning": {
    "Shared Hit Blocks": 494,
    "Shared Read Blocks": 44,
    "Shared Dirtied Blocks": 0,
    "Shared Written Blocks": 0,
    "Local Hit Blocks": 0,
    "Local Read Blocks": 0,
    "Local Dirtied Blocks": 0,
    "Local Written Blocks": 0,
    "Temp Read Blocks": 0,
    "Temp Written Blocks": 0
  },
  "Planning Time": 9.089,
  "Triggers": [],
  "Execution Time": 459.298
}