{
  "Query Text": "SELECT /* ISNULL:pc_message.FrozenSetID:, KeyTable:pc_message; */ qRoot.ID col0, qRoot.CreationTime col1 FROM pc_message qRoot WHERE qRoot.DestinationID = $1 AND qRoot.Status = $2 AND qRoot.contactID IS NOT NULL AND qRoot.FrozenSetID IS NULL AND qRoot.SendOrder IN (SELECT MIN(qRoot0.SendOrder) col0 FROM pc_message qRoot0 WHERE qRoot0.DestinationID = $3 AND qRoot0.contactID = qRoot.contactID) ORDER BY col1 ASC, col0 ASC LIMIT 100000",
  "Plan": {
    "Node Type": "Limit",
    "Parallel Aware": false,
    "Startup Cost": 881232.73,
    "Total Cost": 881232.92,
    "Plan Rows": 78,
    "Plan Width": 16,
    "Actual Startup Time": 1366.333,
    "Actual Total Time": 1366.336,
    "Actual Rows": 0,
    "Actual Loops": 1,
    "Shared Hit Blocks": 920665,
    "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,
    "I/O Read Time": 0.000,
    "I/O Write Time": 0.000,
    "Plans": [
      {
        "Node Type": "Sort",
        "Parent Relationship": "Outer",
        "Parallel Aware": false,
        "Startup Cost": 881232.73,
        "Total Cost": 881232.92,
        "Plan Rows": 78,
        "Plan Width": 16,
        "Actual Startup Time": 1366.333,
        "Actual Total Time": 1366.335,
        "Actual Rows": 0,
        "Actual Loops": 1,
        "Sort Key": ["qroot.creationtime", "qroot.id"],
        "Sort Method": "quicksort",
        "Sort Space Used": 25,
        "Sort Space Type": "Memory",
        "Shared Hit Blocks": 920665,
        "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,
        "I/O Read Time": 0.000,
        "I/O Write Time": 0.000,
        "Plans": [
          {
            "Node Type": "Nested Loop",
            "Parent Relationship": "Outer",
            "Parallel Aware": false,
            "Join Type": "Inner",
            "Startup Cost": 79089.68,
            "Total Cost": 881230.28,
            "Plan Rows": 78,
            "Plan Width": 16,
            "Actual Startup Time": 1366.326,
            "Actual Total Time": 1366.328,
            "Actual Rows": 0,
            "Actual Loops": 1,
            "Inner Unique": true,
            "Shared Hit Blocks": 920665,
            "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,
            "I/O Read Time": 0.000,
            "I/O Write Time": 0.000,
            "Plans": [
              {
                "Node Type": "Bitmap Heap Scan",
                "Parent Relationship": "Outer",
                "Parallel Aware": false,
                "Relation Name": "pc_message",
                "Alias": "qroot",
                "Startup Cost": 79088.96,
                "Total Cost": 487032.85,
                "Plan Rows": 524659,
                "Plan Width": 28,
                "Actual Startup Time": 26.913,
                "Actual Total Time": 182.692,
                "Actual Rows": 145956,
                "Actual Loops": 1,
                "Recheck Cond": "((destinationid = 67) AND (contactid IS NOT NULL) AND (status = 1))",
                "Rows Removed by Index Recheck": 0,
                "Filter": "(frozensetid IS NULL)",
                "Rows Removed by Filter": 0,
                "Exact Heap Blocks": 43022,
                "Lossy Heap Blocks": 0,
                "Shared Hit Blocks": 48248,
                "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,
                "I/O Read Time": 0.000,
                "I/O Write Time": 0.000,
                "Plans": [
                  {
                    "Node Type": "Bitmap Index Scan",
                    "Parent Relationship": "Outer",
                    "Parallel Aware": false,
                    "Index Name": "message_u_destinatio_1kk5be278gggc",
                    "Startup Cost": 0.00,
                    "Total Cost": 78957.80,
                    "Plan Rows": 524659,
                    "Plan Width": 0,
                    "Actual Startup Time": 20.933,
                    "Actual Total Time": 20.934,
                    "Actual Rows": 146015,
                    "Actual Loops": 1,
                    "Index Cond": "((destinationid = 67) AND (contactid IS NOT NULL) AND (status = 1))",
                    "Shared Hit Blocks": 5218,
                    "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,
                    "I/O Read Time": 0.000,
                    "I/O Write Time": 0.000
                  }
                ]
              },
              {
                "Node Type": "Subquery Scan",
                "Parent Relationship": "Inner",
                "Parallel Aware": false,
                "Alias": "ANY_subquery",
                "Startup Cost": 0.72,
                "Total Cost": 0.74,
                "Plan Rows": 1,
                "Plan Width": 4,
                "Actual Startup Time": 0.008,
                "Actual Total Time": 0.008,
                "Actual Rows": 0,
                "Actual Loops": 145956,
                "Filter": "(qroot.sendorder = \"ANY_subquery\".col0)",
                "Rows Removed by Filter": 1,
                "Shared Hit Blocks": 872417,
                "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,
                "I/O Read Time": 0.000,
                "I/O Write Time": 0.000,
                "Plans": [
                  {
                    "Node Type": "Result",
                    "Parent Relationship": "Subquery",
                    "Parallel Aware": false,
                    "Startup Cost": 0.72,
                    "Total Cost": 0.73,
                    "Plan Rows": 1,
                    "Plan Width": 4,
                    "Actual Startup Time": 0.008,
                    "Actual Total Time": 0.008,
                    "Actual Rows": 1,
                    "Actual Loops": 145956,
                    "Shared Hit Blocks": 872417,
                    "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,
                    "I/O Read Time": 0.000,
                    "I/O Write Time": 0.000,
                    "Plans": [
                      {
                        "Node Type": "Limit",
                        "Parent Relationship": "InitPlan",
                        "Subplan Name": "InitPlan 1 (returns $1)",
                        "Parallel Aware": false,
                        "Startup Cost": 0.55,
                        "Total Cost": 0.72,
                        "Plan Rows": 1,
                        "Plan Width": 4,
                        "Actual Startup Time": 0.007,
                        "Actual Total Time": 0.007,
                        "Actual Rows": 1,
                        "Actual Loops": 145956,
                        "Shared Hit Blocks": 872417,
                        "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,
                        "I/O Read Time": 0.000,
                        "I/O Write Time": 0.000,
                        "Plans": [
                          {
                            "Node Type": "Index Only Scan",
                            "Parent Relationship": "Outer",
                            "Parallel Aware": false,
                            "Scan Direction": "Forward",
                            "Index Name": "message_u_destinatio_1kk5be278gggc",
                            "Relation Name": "pc_message",
                            "Alias": "qroot0",
                            "Startup Cost": 0.55,
                            "Total Cost": 25.20,
                            "Plan Rows": 146,
                            "Plan Width": 4,
                            "Actual Startup Time": 0.006,
                            "Actual Total Time": 0.006,
                            "Actual Rows": 1,
                            "Actual Loops": 145956,
                            "Index Cond": "((destinationid = 67) AND (contactid = $0) AND (sendorder IS NOT NULL))",
                            "Rows Removed by Index Recheck": 0,
                            "Heap Fetches": 48498,
                            "Shared Hit Blocks": 872417,
                            "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,
                            "I/O Read Time": 0.000,
                            "I/O Write Time": 0.000
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}