{
  "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": 53068.23,
    "Total Cost": 53068.24,
    "Plan Rows": 2,
    "Plan Width": 16,
    "Actual Startup Time": 1425.937,
    "Actual Total Time": 1425.940,
    "Actual Rows": 0,
    "Actual Loops": 1,
    "Shared Hit Blocks": 946760,
    "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": 53068.23,
        "Total Cost": 53068.24,
        "Plan Rows": 2,
        "Plan Width": 16,
        "Actual Startup Time": 1425.937,
        "Actual Total Time": 1425.939,
        "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": 946760,
        "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": 15096.69,
            "Total Cost": 53068.22,
            "Plan Rows": 2,
            "Plan Width": 16,
            "Actual Startup Time": 1425.929,
            "Actual Total Time": 1425.931,
            "Actual Rows": 0,
            "Actual Loops": 1,
            "Inner Unique": true,
            "Shared Hit Blocks": 946760,
            "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": 15095.50,
                "Total Cost": 32208.92,
                "Plan Rows": 17028,
                "Plan Width": 28,
                "Actual Startup Time": 27.261,
                "Actual Total Time": 189.915,
                "Actual Rows": 150128,
                "Actual Loops": 1,
                "Recheck Cond": "((destinationid = $1) AND (contactid IS NOT NULL) AND (status = $2))",
                "Rows Removed by Index Recheck": 0,
                "Filter": "(frozensetid IS NULL)",
                "Rows Removed by Filter": 0,
                "Exact Heap Blocks": 44083,
                "Lossy Heap Blocks": 0,
                "Shared Hit Blocks": 49377,
                "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": 15091.25,
                    "Plan Rows": 17028,
                    "Plan Width": 0,
                    "Actual Startup Time": 21.144,
                    "Actual Total Time": 21.145,
                    "Actual Rows": 150138,
                    "Actual Loops": 1,
                    "Index Cond": "((destinationid = $1) AND (contactid IS NOT NULL) AND (status = $2))",
                    "Shared Hit Blocks": 5290,
                    "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": 1.19,
                "Total Cost": 1.21,
                "Plan Rows": 1,
                "Plan Width": 4,
                "Actual Startup Time": 0.008,
                "Actual Total Time": 0.008,
                "Actual Rows": 0,
                "Actual Loops": 150128,
                "Filter": "(qroot.sendorder = \"ANY_subquery\".col0)",
                "Rows Removed by Filter": 1,
                "Shared Hit Blocks": 897383,
                "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": 1.19,
                    "Total Cost": 1.20,
                    "Plan Rows": 1,
                    "Plan Width": 4,
                    "Actual Startup Time": 0.008,
                    "Actual Total Time": 0.008,
                    "Actual Rows": 1,
                    "Actual Loops": 150128,
                    "Shared Hit Blocks": 897383,
                    "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": 1.19,
                        "Plan Rows": 1,
                        "Plan Width": 4,
                        "Actual Startup Time": 0.007,
                        "Actual Total Time": 0.007,
                        "Actual Rows": 1,
                        "Actual Loops": 150128,
                        "Shared Hit Blocks": 897383,
                        "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": 5.72,
                            "Plan Rows": 8,
                            "Plan Width": 4,
                            "Actual Startup Time": 0.006,
                            "Actual Total Time": 0.006,
                            "Actual Rows": 1,
                            "Actual Loops": 150128,
                            "Index Cond": "((destinationid = $3) AND (contactid = $0) AND (sendorder IS NOT NULL))",
                            "Rows Removed by Index Recheck": 0,
                            "Heap Fetches": 41581,
                            "Shared Hit Blocks": 897383,
                            "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
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}