{
  "Plan": {
    "Node Type": "Limit",
    "Parallel Aware": false,
    "Async Capable": false,
    "Startup Cost": 61990.17,
    "Total Cost": 61990.98,
    "Plan Rows": 1,
    "Plan Width": 573,
    "Actual Rows": 51.0,
    "Actual Loops": 1,
    "Disabled": false,
    "Shared Hit Blocks": 3564,
    "Shared Read Blocks": 35367,
    "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": 3729,
    "Temp Written Blocks": 2494,
    "Plans": [
      {
        "Node Type": "Unique",
        "Parent Relationship": "InitPlan",
        "Subplan Name": "CTE canonical_revenue",
        "Parallel Aware": false,
        "Async Capable": false,
        "Startup Cost": 54679.32,
        "Total Cost": 56134.02,
        "Plan Rows": 19396,
        "Plan Width": 64,
        "Actual Rows": 193938.0,
        "Actual Loops": 1,
        "Disabled": false,
        "Shared Hit Blocks": 0,
        "Shared Read Blocks": 22592,
        "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": 1247,
        "Temp Written Blocks": 1251,
        "Plans": [
          {
            "Node Type": "Sort",
            "Parent Relationship": "Outer",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 54679.32,
            "Total Cost": 55164.22,
            "Plan Rows": 193960,
            "Plan Width": 64,
            "Actual Rows": 193960.0,
            "Actual Loops": 1,
            "Disabled": false,
            "Sort Key": [
              "r_2.mops_company_id",
              "r_2.period",
              "r_2.revision DESC"
            ],
            "Sort Method": "external merge",
            "Sort Space Used": 9976,
            "Sort Space Type": "Disk",
            "Shared Hit Blocks": 0,
            "Shared Read Blocks": 22592,
            "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": 1247,
            "Temp Written Blocks": 1251,
            "Plans": [
              {
                "Node Type": "Seq Scan",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Relation Name": "mops_monthly_revenue",
                "Alias": "r_2",
                "Startup Cost": 0.0,
                "Total Cost": 30350.4,
                "Plan Rows": 193960,
                "Plan Width": 64,
                "Actual Rows": 193960.0,
                "Actual Loops": 1,
                "Disabled": false,
                "Filter": "(currency = 'TWD'::text)",
                "Rows Removed by Filter": 0,
                "Shared Hit Blocks": 0,
                "Shared Read Blocks": 22592,
                "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": "Aggregate",
        "Strategy": "Sorted",
        "Partial Mode": "Simple",
        "Parent Relationship": "InitPlan",
        "Subplan Name": "CTE latest_period",
        "Parallel Aware": false,
        "Async Capable": false,
        "Startup Cost": 0.0,
        "Total Cost": 535.39,
        "Plan Rows": 200,
        "Plan Width": 24,
        "Actual Rows": 1987.0,
        "Actual Loops": 1,
        "Disabled": false,
        "Group Key": [
          "canonical_revenue.mops_company_id"
        ],
        "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": 834,
        "Temp Written Blocks": 1242,
        "Plans": [
          {
            "Node Type": "CTE Scan",
            "Parent Relationship": "Outer",
            "Parallel Aware": false,
            "Async Capable": false,
            "CTE Name": "canonical_revenue",
            "Alias": "canonical_revenue",
            "Startup Cost": 0.0,
            "Total Cost": 387.92,
            "Plan Rows": 19396,
            "Plan Width": 24,
            "Actual Rows": 193938.0,
            "Actual Loops": 1,
            "Disabled": false,
            "Storage": "Disk",
            "Maximum Storage": 9938,
            "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": 834,
            "Temp Written Blocks": 1242
          }
        ]
      },
      {
        "Node Type": "Result",
        "Parent Relationship": "Outer",
        "Parallel Aware": false,
        "Async Capable": false,
        "Startup Cost": 5320.75,
        "Total Cost": 5321.56,
        "Plan Rows": 1,
        "Plan Width": 573,
        "Actual Rows": 51.0,
        "Actual Loops": 1,
        "Disabled": false,
        "Shared Hit Blocks": 3564,
        "Shared Read Blocks": 35367,
        "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": 3729,
        "Temp Written Blocks": 2494,
        "Plans": [
          {
            "Node Type": "Sort",
            "Parent Relationship": "Outer",
            "Parallel Aware": false,
            "Async Capable": false,
            "Startup Cost": 5320.75,
            "Total Cost": 5320.76,
            "Plan Rows": 1,
            "Plan Width": 541,
            "Actual Rows": 51.0,
            "Actual Loops": 1,
            "Disabled": false,
            "Sort Key": [
              "(round(((((('10'::numeric + LEAST('20'::numeric, (GREATEST('0'::numeric, (((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric) / '5'::numeric))) + LEAST('20'::numeric, (GREATEST('0'::numeric, ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric)) / '5'::numeric))) + LEAST('15'::numeric, (GREATEST('0'::numeric, ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric)) / 6.6666667))) + GREATEST('0'::numeric, ('20'::numeric - ((snapshot.market_capitalization / NULLIF(((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) * ('1'::numeric + (LEAST('500'::numeric, GREATEST('0'::numeric, (((((((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric + ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric)) + ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric)) - GREATEST((((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric, ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric), ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric))) - LEAST((((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric, ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric), ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric))))) / '100'::numeric))), '0'::numeric)) * '2'::numeric)))) + GREATEST('0'::numeric, ('15'::numeric - ((snapshot.market_capitalization / NULLIF((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))), '0'::numeric)) / '4'::numeric)))), 1)) DESC NULLS LAST",
              "c.mops_code"
            ],
            "Sort Method": "quicksort",
            "Sort Space Used": 50,
            "Sort Space Type": "Memory",
            "Shared Hit Blocks": 3564,
            "Shared Read Blocks": 35367,
            "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": 3729,
            "Temp Written Blocks": 2494,
            "Plans": [
              {
                "Node Type": "WindowAgg",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Async Capable": false,
                "Startup Cost": 1207.04,
                "Total Cost": 5320.74,
                "Plan Rows": 1,
                "Plan Width": 541,
                "Actual Rows": 51.0,
                "Actual Loops": 1,
                "Disabled": false,
                "Window": "w1 AS ()",
                "Storage": "Memory",
                "Maximum Storage": 26,
                "Shared Hit Blocks": 3558,
                "Shared Read Blocks": 35367,
                "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": 3729,
                "Temp Written Blocks": 2494,
                "Plans": [
                  {
                    "Node Type": "Nested Loop",
                    "Parent Relationship": "Outer",
                    "Parallel Aware": false,
                    "Async Capable": false,
                    "Join Type": "Left",
                    "Startup Cost": 1207.04,
                    "Total Cost": 5320.39,
                    "Plan Rows": 1,
                    "Plan Width": 313,
                    "Actual Rows": 51.0,
                    "Actual Loops": 1,
                    "Disabled": false,
                    "Inner Unique": false,
                    "Join Filter": "(candle.session_date = snapshot.session_date)",
                    "Rows Removed by Join Filter": 175018,
                    "Shared Hit Blocks": 3558,
                    "Shared Read Blocks": 35367,
                    "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": 3729,
                    "Temp Written Blocks": 2494,
                    "Plans": [
                      {
                        "Node Type": "Nested Loop",
                        "Parent Relationship": "Outer",
                        "Parallel Aware": false,
                        "Async Capable": false,
                        "Join Type": "Left",
                        "Startup Cost": 1147.16,
                        "Total Cost": 1848.47,
                        "Plan Rows": 1,
                        "Plan Width": 321,
                        "Actual Rows": 51.0,
                        "Actual Loops": 1,
                        "Disabled": false,
                        "Inner Unique": false,
                        "Join Filter": "(series.source_id = source.id)",
                        "Rows Removed by Join Filter": 0,
                        "Shared Hit Blocks": 881,
                        "Shared Read Blocks": 22867,
                        "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": 3729,
                        "Temp Written Blocks": 2494,
                        "Plans": [
                          {
                            "Node Type": "Nested Loop",
                            "Parent Relationship": "Outer",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Join Type": "Inner",
                            "Startup Cost": 1146.88,
                            "Total Cost": 1843.85,
                            "Plan Rows": 1,
                            "Plan Width": 337,
                            "Actual Rows": 51.0,
                            "Actual Loops": 1,
                            "Disabled": false,
                            "Inner Unique": true,
                            "Join Filter": "((source.id = snapshot.source_id) AND ((snapshot.market_capitalization / NULLIF((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))), '0'::numeric)) <= '60'::numeric) AND ((snapshot.market_capitalization / NULLIF(((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) * ('1'::numeric + (LEAST('500'::numeric, GREATEST('0'::numeric, (((((((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric + ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric)) + ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric)) - GREATEST((((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric, ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric), ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric))) - LEAST((((power((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1))) / NULLIF((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)))::double precision, '0.5'::double precision) - '1'::double precision) * '100'::double precision))::numeric, ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric), ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index)))) - (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))) / NULLIF(abs((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))))), '0'::numeric)) * '100'::numeric))))) / '100'::numeric))), '0'::numeric)) <= '10'::numeric))",
                            "Rows Removed by Join Filter": 3,
                            "Shared Hit Blocks": 806,
                            "Shared Read Blocks": 22788,
                            "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": 3729,
                            "Temp Written Blocks": 2494,
                            "Plans": [
                              {
                                "Node Type": "Nested Loop",
                                "Parent Relationship": "Outer",
                                "Parallel Aware": false,
                                "Async Capable": false,
                                "Join Type": "Inner",
                                "Startup Cost": 1146.6,
                                "Total Cost": 1840.66,
                                "Plan Rows": 1,
                                "Plan Width": 318,
                                "Actual Rows": 73.0,
                                "Actual Loops": 1,
                                "Disabled": false,
                                "Inner Unique": false,
                                "Shared Hit Blocks": 668,
                                "Shared Read Blocks": 22707,
                                "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": 3729,
                                "Temp Written Blocks": 2494,
                                "Plans": [
                                  {
                                    "Node Type": "Nested Loop",
                                    "Parent Relationship": "Outer",
                                    "Parallel Aware": false,
                                    "Async Capable": false,
                                    "Join Type": "Inner",
                                    "Startup Cost": 1146.6,
                                    "Total Cost": 1839.56,
                                    "Plan Rows": 1,
                                    "Plan Width": 302,
                                    "Actual Rows": 73.0,
                                    "Actual Loops": 1,
                                    "Disabled": false,
                                    "Inner Unique": true,
                                    "Join Filter": "(venue.id = instrument.venue_id)",
                                    "Rows Removed by Join Filter": 0,
                                    "Shared Hit Blocks": 595,
                                    "Shared Read Blocks": 22707,
                                    "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": 3729,
                                    "Temp Written Blocks": 2494,
                                    "Plans": [
                                      {
                                        "Node Type": "Nested Loop",
                                        "Parent Relationship": "Outer",
                                        "Parallel Aware": false,
                                        "Async Capable": false,
                                        "Join Type": "Inner",
                                        "Startup Cost": 1146.6,
                                        "Total Cost": 1838.49,
                                        "Plan Rows": 1,
                                        "Plan Width": 318,
                                        "Actual Rows": 73.0,
                                        "Actual Loops": 1,
                                        "Disabled": false,
                                        "Inner Unique": false,
                                        "Shared Hit Blocks": 522,
                                        "Shared Read Blocks": 22707,
                                        "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": 3729,
                                        "Temp Written Blocks": 2494,
                                        "Plans": [
                                          {
                                            "Node Type": "Nested Loop",
                                            "Parent Relationship": "Outer",
                                            "Parallel Aware": false,
                                            "Async Capable": false,
                                            "Join Type": "Inner",
                                            "Startup Cost": 1146.31,
                                            "Total Cost": 1835.18,
                                            "Plan Rows": 1,
                                            "Plan Width": 302,
                                            "Actual Rows": 73.0,
                                            "Actual Loops": 1,
                                            "Disabled": false,
                                            "Inner Unique": true,
                                            "Join Filter": "(a.mops_company_id = c.id)",
                                            "Rows Removed by Join Filter": 0,
                                            "Shared Hit Blocks": 378,
                                            "Shared Read Blocks": 22631,
                                            "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": 3729,
                                            "Temp Written Blocks": 2494,
                                            "Plans": [
                                              {
                                                "Node Type": "Nested Loop",
                                                "Parent Relationship": "Outer",
                                                "Parallel Aware": false,
                                                "Async Capable": false,
                                                "Join Type": "Inner",
                                                "Startup Cost": 1146.03,
                                                "Total Cost": 1826.87,
                                                "Plan Rows": 1,
                                                "Plan Width": 272,
                                                "Actual Rows": 137.0,
                                                "Actual Loops": 1,
                                                "Disabled": false,
                                                "Inner Unique": true,
                                                "Join Filter": "(lp.mops_company_id = a.mops_company_id)",
                                                "Rows Removed by Join Filter": 97892,
                                                "Shared Hit Blocks": 6,
                                                "Shared Read Blocks": 22592,
                                                "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": 3729,
                                                "Temp Written Blocks": 2494,
                                                "Plans": [
                                                  {
                                                    "Node Type": "Aggregate",
                                                    "Strategy": "Sorted",
                                                    "Partial Mode": "Simple",
                                                    "Parent Relationship": "Outer",
                                                    "Parallel Aware": false,
                                                    "Async Capable": false,
                                                    "Startup Cost": 2.97,
                                                    "Total Cost": 682.58,
                                                    "Plan Rows": 1,
                                                    "Plan Width": 184,
                                                    "Actual Rows": 400.0,
                                                    "Actual Loops": 1,
                                                    "Disabled": false,
                                                    "Group Key": [
                                                      "lp.mops_company_id",
                                                      "lp.latest_revenue_period",
                                                      "lp.latest_month_index"
                                                    ],
                                                    "Filter": "((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index))) > '0'::numeric) AND (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))) > '0'::numeric) AND (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index))) > '0'::numeric) AND (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))) > '0'::numeric) AND (sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index))) >= '1000000000'::numeric) AND (count(*) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index))) = 12) AND (count(*) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12)))) = 12) AND (count(*) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index))) = 3) AND (count(*) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12)))) = 3) AND ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 11)) AND (r.month_index <= lp.latest_month_index))) - sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12))))) / NULLIF(abs(sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 23)) AND (r.month_index <= (lp.latest_month_index - 12))))), '0'::numeric)) * '100'::numeric) >= '20'::numeric) AND ((((sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 2)) AND (r.month_index <= lp.latest_month_index))) - sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12))))) / NULLIF(abs(sum(r.revenue_twd) FILTER (WHERE ((r.month_index >= (lp.latest_month_index - 14)) AND (r.month_index <= (lp.latest_month_index - 12))))), '0'::numeric)) * '100'::numeric) >= '20'::numeric))",
                                                    "Rows Removed by Filter": 1582,
                                                    "Shared Hit Blocks": 6,
                                                    "Shared Read Blocks": 22592,
                                                    "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": 1652,
                                                    "Temp Written Blocks": 1251,
                                                    "Plans": [
                                                      {
                                                        "Node Type": "Incremental Sort",
                                                        "Parent Relationship": "Outer",
                                                        "Parallel Aware": false,
                                                        "Async Capable": false,
                                                        "Startup Cost": 2.97,
                                                        "Total Cost": 607.33,
                                                        "Plan Rows": 722,
                                                        "Plan Width": 60,
                                                        "Actual Rows": 47128.0,
                                                        "Actual Loops": 1,
                                                        "Disabled": false,
                                                        "Sort Key": [
                                                          "lp.mops_company_id",
                                                          "lp.latest_revenue_period",
                                                          "lp.latest_month_index"
                                                        ],
                                                        "Presorted Key": [
                                                          "lp.mops_company_id"
                                                        ],
                                                        "Full-sort Groups": {
                                                          "Group Count": 983,
                                                          "Sort Methods Used": [
                                                            "quicksort"
                                                          ],
                                                          "Sort Space Memory": {
                                                            "Average Sort Space Used": 27,
                                                            "Peak Sort Space Used": 27
                                                          }
                                                        },
                                                        "Shared Hit Blocks": 6,
                                                        "Shared Read Blocks": 22592,
                                                        "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": 1652,
                                                        "Temp Written Blocks": 1251,
                                                        "Plans": [
                                                          {
                                                            "Node Type": "Merge Join",
                                                            "Parent Relationship": "Outer",
                                                            "Parallel Aware": false,
                                                            "Async Capable": false,
                                                            "Join Type": "Inner",
                                                            "Startup Cost": 0.0,
                                                            "Total Cost": 587.62,
                                                            "Plan Rows": 722,
                                                            "Plan Width": 60,
                                                            "Actual Rows": 47128.0,
                                                            "Actual Loops": 1,
                                                            "Disabled": false,
                                                            "Inner Unique": false,
                                                            "Merge Cond": "(r.mops_company_id = lp.mops_company_id)",
                                                            "Join Filter": "((r.month_index <= lp.latest_month_index) AND (r.month_index >= (lp.latest_month_index - 23)))",
                                                            "Rows Removed by Join Filter": 146296,
                                                            "Shared Hit Blocks": 0,
                                                            "Shared Read Blocks": 22592,
                                                            "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": 1652,
                                                            "Temp Written Blocks": 1251,
                                                            "Plans": [
                                                              {
                                                                "Node Type": "CTE Scan",
                                                                "Parent Relationship": "Outer",
                                                                "Parallel Aware": false,
                                                                "Async Capable": false,
                                                                "CTE Name": "canonical_revenue",
                                                                "Alias": "r",
                                                                "Startup Cost": 0.0,
                                                                "Total Cost": 387.92,
                                                                "Plan Rows": 19396,
                                                                "Plan Width": 52,
                                                                "Actual Rows": 193938.0,
                                                                "Actual Loops": 1,
                                                                "Disabled": false,
                                                                "Storage": "Disk",
                                                                "Maximum Storage": 9938,
                                                                "Shared Hit Blocks": 0,
                                                                "Shared Read Blocks": 22592,
                                                                "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": 1652,
                                                                "Temp Written Blocks": 1251
                                                              },
                                                              {
                                                                "Node Type": "Materialize",
                                                                "Parent Relationship": "Inner",
                                                                "Parallel Aware": false,
                                                                "Async Capable": false,
                                                                "Startup Cost": 0.0,
                                                                "Total Cost": 5.17,
                                                                "Plan Rows": 67,
                                                                "Plan Width": 24,
                                                                "Actual Rows": 193320.0,
                                                                "Actual Loops": 1,
                                                                "Disabled": false,
                                                                "Storage": "Memory",
                                                                "Maximum Storage": 17,
                                                                "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": 0,
                                                                "Temp Written Blocks": 0,
                                                                "Plans": [
                                                                  {
                                                                    "Node Type": "CTE Scan",
                                                                    "Parent Relationship": "Outer",
                                                                    "Parallel Aware": false,
                                                                    "Async Capable": false,
                                                                    "CTE Name": "latest_period",
                                                                    "Alias": "lp",
                                                                    "Startup Cost": 0.0,
                                                                    "Total Cost": 5.0,
                                                                    "Plan Rows": 67,
                                                                    "Plan Width": 24,
                                                                    "Actual Rows": 1982.0,
                                                                    "Actual Loops": 1,
                                                                    "Disabled": false,
                                                                    "Filter": "(('2026-11-02'::date - latest_revenue_period) <= 90)",
                                                                    "Rows Removed by Filter": 5,
                                                                    "Storage": "Memory",
                                                                    "Maximum Storage": 110,
                                                                    "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": 0,
                                                                    "Temp Written Blocks": 0
                                                                  }
                                                                ]
                                                              }
                                                            ]
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  },
                                                  {
                                                    "Node Type": "Aggregate",
                                                    "Strategy": "Sorted",
                                                    "Partial Mode": "Simple",
                                                    "Parent Relationship": "Inner",
                                                    "Parallel Aware": false,
                                                    "Async Capable": false,
                                                    "Startup Cost": 1143.06,
                                                    "Total Cost": 1144.26,
                                                    "Plan Rows": 1,
                                                    "Plan Width": 124,
                                                    "Actual Rows": 245.07,
                                                    "Actual Loops": 400,
                                                    "Disabled": false,
                                                    "Group Key": [
                                                      "a.mops_company_id"
                                                    ],
                                                    "Filter": "((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1)) > '0'::numeric) AND (max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 2)) > '0'::numeric) AND (max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3)) > '0'::numeric) AND (max(a.revenue_year) FILTER (WHERE ((row_number() OVER w1) = 1)) = (max(a.revenue_year) FILTER (WHERE ((row_number() OVER w1) = 2)) + 1)) AND (max(a.revenue_year) FILTER (WHERE ((row_number() OVER w1) = 2)) = (max(a.revenue_year) FILTER (WHERE ((row_number() OVER w1) = 3)) + 1)) AND ((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 2)) - max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))) / NULLIF(abs(max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 3))), '0'::numeric)) * '100'::numeric) >= '10'::numeric) AND ((((max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 1)) - max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 2))) / NULLIF(abs(max(a.annual_revenue) FILTER (WHERE ((row_number() OVER w1) = 2))), '0'::numeric)) * '100'::numeric) >= '10'::numeric))",
                                                    "Rows Removed by Filter": 1369,
                                                    "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": 2077,
                                                    "Temp Written Blocks": 1243,
                                                    "Plans": [
                                                      {
                                                        "Node Type": "WindowAgg",
                                                        "Parent Relationship": "Outer",
                                                        "Parallel Aware": false,
                                                        "Async Capable": false,
                                                        "Startup Cost": 1143.06,
                                                        "Total Cost": 1143.26,
                                                        "Plan Rows": 10,
                                                        "Plan Width": 68,
                                                        "Actual Rows": 4743.16,
                                                        "Actual Loops": 400,
                                                        "Disabled": false,
                                                        "Window": "w1 AS (PARTITION BY a.mops_company_id ORDER BY a.revenue_year ROWS UNBOUNDED PRECEDING)",
                                                        "Run Condition": "(row_number() OVER w1 <= 3)",
                                                        "Storage": "Memory",
                                                        "Maximum Storage": 17,
                                                        "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": 2077,
                                                        "Temp Written Blocks": 1243,
                                                        "Plans": [
                                                          {
                                                            "Node Type": "Sort",
                                                            "Parent Relationship": "Outer",
                                                            "Parallel Aware": false,
                                                            "Async Capable": false,
                                                            "Startup Cost": 1143.06,
                                                            "Total Cost": 1143.09,
                                                            "Plan Rows": 10,
                                                            "Plan Width": 52,
                                                            "Actual Rows": 11992.67,
                                                            "Actual Loops": 400,
                                                            "Disabled": false,
                                                            "Sort Key": [
                                                              "a.mops_company_id",
                                                              "a.revenue_year DESC"
                                                            ],
                                                            "Sort Method": "quicksort",
                                                            "Sort Space Used": 1068,
                                                            "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": 2077,
                                                            "Temp Written Blocks": 1243,
                                                            "Plans": [
                                                              {
                                                                "Node Type": "Subquery Scan",
                                                                "Parent Relationship": "Outer",
                                                                "Parallel Aware": false,
                                                                "Async Capable": false,
                                                                "Alias": "a",
                                                                "Startup Cost": 1113.69,
                                                                "Total Cost": 1142.89,
                                                                "Plan Rows": 10,
                                                                "Plan Width": 52,
                                                                "Actual Rows": 14573.0,
                                                                "Actual Loops": 1,
                                                                "Disabled": false,
                                                                "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": 2077,
                                                                "Temp Written Blocks": 1243,
                                                                "Plans": [
                                                                  {
                                                                    "Node Type": "Aggregate",
                                                                    "Strategy": "Hashed",
                                                                    "Partial Mode": "Simple",
                                                                    "Parent Relationship": "Subquery",
                                                                    "Parallel Aware": false,
                                                                    "Async Capable": false,
                                                                    "Startup Cost": 1113.69,
                                                                    "Total Cost": 1142.79,
                                                                    "Plan Rows": 10,
                                                                    "Plan Width": 60,
                                                                    "Actual Rows": 14573.0,
                                                                    "Actual Loops": 1,
                                                                    "Disabled": false,
                                                                    "Group Key": [
                                                                      "r_1.mops_company_id",
                                                                      "r_1.revenue_year"
                                                                    ],
                                                                    "Filter": "(count(*) = 12)",
                                                                    "Planned Partitions": 0,
                                                                    "HashAgg Batches": 1,
                                                                    "Peak Memory Usage": 6417,
                                                                    "Disk Usage": 0,
                                                                    "Rows Removed by Filter": 250,
                                                                    "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": 2077,
                                                                    "Temp Written Blocks": 1243,
                                                                    "Plans": [
                                                                      {
                                                                        "Node Type": "Hash Join",
                                                                        "Parent Relationship": "Outer",
                                                                        "Parallel Aware": false,
                                                                        "Async Capable": false,
                                                                        "Join Type": "Inner",
                                                                        "Startup Cost": 6.5,
                                                                        "Total Cost": 1049.04,
                                                                        "Plan Rows": 6466,
                                                                        "Plan Width": 52,
                                                                        "Actual Rows": 176174.0,
                                                                        "Actual Loops": 1,
                                                                        "Disabled": false,
                                                                        "Inner Unique": false,
                                                                        "Hash Cond": "(r_1.mops_company_id = lp_1.mops_company_id)",
                                                                        "Join Filter": "(((r_1.revenue_year)::numeric < EXTRACT(year FROM lp_1.latest_revenue_period)) OR ((EXTRACT(month FROM lp_1.latest_revenue_period) = '12'::numeric) AND ((r_1.revenue_year)::numeric = EXTRACT(year FROM lp_1.latest_revenue_period))))",
                                                                        "Rows Removed by Join Filter": 17764,
                                                                        "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": 2077,
                                                                        "Temp Written Blocks": 1243,
                                                                        "Plans": [
                                                                          {
                                                                            "Node Type": "CTE Scan",
                                                                            "Parent Relationship": "Outer",
                                                                            "Parallel Aware": false,
                                                                            "Async Capable": false,
                                                                            "CTE Name": "canonical_revenue",
                                                                            "Alias": "r_1",
                                                                            "Startup Cost": 0.0,
                                                                            "Total Cost": 387.92,
                                                                            "Plan Rows": 19396,
                                                                            "Plan Width": 52,
                                                                            "Actual Rows": 193938.0,
                                                                            "Actual Loops": 1,
                                                                            "Disabled": false,
                                                                            "Storage": "Disk",
                                                                            "Maximum Storage": 9938,
                                                                            "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": 1243,
                                                                            "Temp Written Blocks": 1
                                                                          },
                                                                          {
                                                                            "Node Type": "Hash",
                                                                            "Parent Relationship": "Inner",
                                                                            "Parallel Aware": false,
                                                                            "Async Capable": false,
                                                                            "Startup Cost": 4.0,
                                                                            "Total Cost": 4.0,
                                                                            "Plan Rows": 200,
                                                                            "Plan Width": 20,
                                                                            "Actual Rows": 1987.0,
                                                                            "Actual Loops": 1,
                                                                            "Disabled": false,
                                                                            "Hash Buckets": 2048,
                                                                            "Original Hash Buckets": 1024,
                                                                            "Hash Batches": 1,
                                                                            "Original Hash Batches": 1,
                                                                            "Peak Memory Usage": 117,
                                                                            "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": 834,
                                                                            "Temp Written Blocks": 1242,
                                                                            "Plans": [
                                                                              {
                                                                                "Node Type": "CTE Scan",
                                                                                "Parent Relationship": "Outer",
                                                                                "Parallel Aware": false,
                                                                                "Async Capable": false,
                                                                                "CTE Name": "latest_period",
                                                                                "Alias": "lp_1",
                                                                                "Startup Cost": 0.0,
                                                                                "Total Cost": 4.0,
                                                                                "Plan Rows": 200,
                                                                                "Plan Width": 20,
                                                                                "Actual Rows": 1987.0,
                                                                                "Actual Loops": 1,
                                                                                "Disabled": false,
                                                                                "Storage": "Memory",
                                                                                "Maximum Storage": 110,
                                                                                "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": 834,
                                                                                "Temp Written Blocks": 1242
                                                                              }
                                                                            ]
                                                                          }
                                                                        ]
                                                                      }
                                                                    ]
                                                                  }
                                                                ]
                                                              }
                                                            ]
                                                          }
                                                        ]
                                                      }
                                                    ]
                                                  }
                                                ]
                                              },
                                              {
                                                "Node Type": "Index Scan",
                                                "Parent Relationship": "Inner",
                                                "Parallel Aware": false,
                                                "Async Capable": false,
                                                "Scan Direction": "Forward",
                                                "Index Name": "mops_company_pkey",
                                                "Relation Name": "mops_company",
                                                "Alias": "c",
                                                "Startup Cost": 0.28,
                                                "Total Cost": 8.3,
                                                "Plan Rows": 1,
                                                "Plan Width": 62,
                                                "Actual Rows": 0.53,
                                                "Actual Loops": 137,
                                                "Disabled": false,
                                                "Index Cond": "(id = lp.mops_company_id)",
                                                "Rows Removed by Index Recheck": 0,
                                                "Filter": "(is_active AND (market = 'TWSE'::mops_market))",
                                                "Rows Removed by Filter": 0,
                                                "Index Searches": 137,
                                                "Shared Hit Blocks": 372,
                                                "Shared Read Blocks": 39,
                                                "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": "Index Scan",
                                            "Parent Relationship": "Inner",
                                            "Parallel Aware": false,
                                            "Async Capable": false,
                                            "Scan Direction": "Forward",
                                            "Index Name": "market_instrument_entity_status_idx",
                                            "Relation Name": "market_instrument",
                                            "Alias": "instrument",
                                            "Startup Cost": 0.29,
                                            "Total Cost": 3.3,
                                            "Plan Rows": 1,
                                            "Plan Width": 53,
                                            "Actual Rows": 1.0,
                                            "Actual Loops": 73,
                                            "Disabled": false,
                                            "Index Cond": "((entity_id = c.direct_entity_id) AND (status = 'ACTIVE'::text))",
                                            "Rows Removed by Index Recheck": 0,
                                            "Filter": "((instrument_kind = 'EQUITY'::text) AND (quote_asset_code = 'TWD'::text) AND (symbol = c.mops_code))",
                                            "Rows Removed by Filter": 0,
                                            "Index Searches": 73,
                                            "Shared Hit Blocks": 144,
                                            "Shared Read Blocks": 76,
                                            "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": "Seq Scan",
                                        "Parent Relationship": "Inner",
                                        "Parallel Aware": false,
                                        "Async Capable": false,
                                        "Relation Name": "market_venue",
                                        "Alias": "venue",
                                        "Startup Cost": 0.0,
                                        "Total Cost": 1.06,
                                        "Plan Rows": 1,
                                        "Plan Width": 16,
                                        "Actual Rows": 1.0,
                                        "Actual Loops": 73,
                                        "Disabled": false,
                                        "Filter": "(code = 'XTAI'::text)",
                                        "Rows Removed by Filter": 3,
                                        "Shared Hit Blocks": 73,
                                        "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": 0,
                                        "Temp Written Blocks": 0
                                      }
                                    ]
                                  },
                                  {
                                    "Node Type": "Seq Scan",
                                    "Parent Relationship": "Inner",
                                    "Parallel Aware": false,
                                    "Async Capable": false,
                                    "Relation Name": "market_data_source",
                                    "Alias": "source",
                                    "Startup Cost": 0.0,
                                    "Total Cost": 1.09,
                                    "Plan Rows": 1,
                                    "Plan Width": 16,
                                    "Actual Rows": 1.0,
                                    "Actual Loops": 73,
                                    "Disabled": false,
                                    "Filter": "(is_active AND (code = 'TWSE'::text))",
                                    "Rows Removed by Filter": 6,
                                    "Shared Hit Blocks": 73,
                                    "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": 0,
                                    "Temp Written Blocks": 0
                                  }
                                ]
                              },
                              {
                                "Node Type": "Index Scan",
                                "Parent Relationship": "Inner",
                                "Parallel Aware": false,
                                "Async Capable": false,
                                "Scan Direction": "Forward",
                                "Index Name": "market_equity_snapshot_pk",
                                "Relation Name": "market_equity_snapshot",
                                "Alias": "snapshot",
                                "Startup Cost": 0.28,
                                "Total Cost": 3.01,
                                "Plan Rows": 1,
                                "Plan Width": 51,
                                "Actual Rows": 0.74,
                                "Actual Loops": 73,
                                "Disabled": false,
                                "Index Cond": "(instrument_id = instrument.id)",
                                "Rows Removed by Index Recheck": 0,
                                "Filter": "((market_capitalization > '0'::numeric) AND (market_capitalization >= '20000000000'::numeric) AND (('2026-11-02'::date - session_date) <= 14))",
                                "Rows Removed by Filter": 0,
                                "Index Searches": 73,
                                "Shared Hit Blocks": 138,
                                "Shared Read Blocks": 81,
                                "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": "Index Scan",
                            "Parent Relationship": "Inner",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Scan Direction": "Forward",
                            "Index Name": "market_candle_series_instrument_active_idx",
                            "Relation Name": "market_candle_series",
                            "Alias": "series",
                            "Startup Cost": 0.29,
                            "Total Cost": 4.61,
                            "Plan Rows": 1,
                            "Plan Width": 48,
                            "Actual Rows": 1.0,
                            "Actual Loops": 51,
                            "Disabled": false,
                            "Index Cond": "((instrument_id = instrument.id) AND (bar_interval = '1d'::text) AND (is_active = true))",
                            "Rows Removed by Index Recheck": 0,
                            "Filter": "((session_scope = 'ALL'::text) AND (price_basis = 'RAW'::text))",
                            "Rows Removed by Filter": 0,
                            "Index Searches": 51,
                            "Shared Hit Blocks": 75,
                            "Shared Read Blocks": 79,
                            "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": "Bitmap Heap Scan",
                        "Parent Relationship": "Inner",
                        "Parallel Aware": false,
                        "Async Capable": false,
                        "Relation Name": "market_candle",
                        "Alias": "candle",
                        "Startup Cost": 59.88,
                        "Total Cost": 3444.15,
                        "Plan Rows": 2222,
                        "Plan Width": 28,
                        "Actual Rows": 3432.73,
                        "Actual Loops": 51,
                        "Disabled": false,
                        "Recheck Cond": "((series_id = series.id) AND (superseded_at IS NULL))",
                        "Rows Removed by Index Recheck": 0,
                        "Exact Heap Blocks": 14112,
                        "Lossy Heap Blocks": 0,
                        "Shared Hit Blocks": 2677,
                        "Shared Read Blocks": 12500,
                        "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": "Bitmap Index Scan",
                            "Parent Relationship": "Outer",
                            "Parallel Aware": false,
                            "Async Capable": false,
                            "Index Name": "market_candle_current_identity_idx",
                            "Startup Cost": 0.0,
                            "Total Cost": 59.32,
                            "Plan Rows": 2222,
                            "Plan Width": 0,
                            "Actual Rows": 3432.73,
                            "Actual Loops": 51,
                            "Disabled": false,
                            "Index Cond": "(series_id = series.id)",
                            "Index Searches": 51,
                            "Shared Hit Blocks": 99,
                            "Shared Read Blocks": 966,
                            "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": 893,
    "Shared Read Blocks": 117,
    "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": 23.435,
  "Triggers": [],
  "Execution Time": 3354.588
}