-- label --
state select • recent file scan

-- original SQL --
SELECT entity_id, updated_at
        FROM state
        WHERE file_id = ?
        ORDER BY updated_at DESC
        LIMIT 20

-- rewritten SQL --
SELECT
  entity_id,
  updated_at
FROM (SELECT
  entity_id,
  file_id,
  updated_at
FROM (SELECT
  entity_id,
  file_id,
  version_id,
  updated_at
FROM (
WITH
  wanted_versions AS (
    SELECT 'boot_0000000000' AS version_id
  )
SELECT
  "w"."entity_id" as "entity_id", "w"."file_id" as "file_id", "w"."version_id" as "version_id", "w"."updated_at" as "updated_at", "w"."snapshot_content" as "snapshot_content"
FROM (
  SELECT
    c.entity_id AS entity_id,
    c.schema_key AS schema_key,
    c.file_id AS file_id,
    c.snapshot_content AS snapshot_content,
    c.version_id AS version_id,
    c.created_at AS created_at,
    c.updated_at AS updated_at,
    c.change_id AS change_id,
    c.priority AS priority,
    ROW_NUMBER() OVER (
            PARTITION BY c.file_id, c.schema_key, c.entity_id, c.version_id
            ORDER BY c.priority, c.created_at DESC, c.file_id, c.schema_key, c.entity_id, c.version_id, c.change_id
          ) AS rn
  FROM (
      SELECT
        unt.entity_id AS entity_id,
        unt.schema_key AS schema_key,
        unt.file_id AS file_id,
        json(unt.snapshot_content) AS snapshot_content,
        unt.version_id AS version_id,
        unt.created_at AS created_at,
        unt.updated_at AS updated_at,
        'untracked' AS change_id,
        2 AS priority
      FROM lix_internal_state_all_untracked unt
      JOIN wanted_versions wv_unt ON wv_unt.version_id = unt.version_id

          UNION ALL

      		SELECT
          cache.entity_id AS entity_id,
          cache.schema_key AS schema_key,
          cache.file_id AS file_id,
          json(cache.snapshot_content) AS snapshot_content,
          cache.version_id AS version_id,
          cache.created_at AS created_at,
          cache.updated_at AS updated_at,
          cache.change_id AS change_id,
          3 AS priority
      		FROM (SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_version_descriptor"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_stored_schema"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_key_value"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_active_account"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_commit"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_commit_edge"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_version_tip"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_change_set"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_change_set_element"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_label"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_bench_state_view") cache
      		JOIN wanted_versions wv_cache ON wv_cache.version_id = cache.version_id

          UNION ALL

      		SELECT
          cache.entity_id AS entity_id,
          cache.schema_key AS schema_key,
          cache.file_id AS file_id,
          json(cache.snapshot_content) AS snapshot_content,
          vi.version_id AS version_id,
          cache.created_at AS created_at,
          cache.updated_at AS updated_at,
          cache.change_id AS change_id,
          4 AS priority
      		FROM (
      SELECT 'boot_0000000000' AS version_id, 'global' AS ancestor_version_id
      ) AS vi
      		JOIN wanted_versions wv_vi ON wv_vi.version_id = vi.version_id
      		JOIN (SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_version_descriptor"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_stored_schema"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_key_value"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_active_account"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_commit"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_commit_edge"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_version_tip"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_change_set"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_change_set_element"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_lix_label"
      UNION ALL
      SELECT
          "entity_id",
          "schema_key",
          "file_id",
          "snapshot_content",
          "version_id",
          "created_at",
          "updated_at",
          "change_id",
          "is_tombstone"
        FROM "lix_internal_state_cache_v1_bench_state_view") cache ON cache.version_id = vi.ancestor_version_id
      		WHERE cache.is_tombstone = 0
      		  AND cache.snapshot_content IS NOT NULL

          UNION ALL

      		SELECT
          unt.entity_id AS entity_id,
          unt.schema_key AS schema_key,
          unt.file_id AS file_id,
          json(unt.snapshot_content) AS snapshot_content,
          vi.version_id AS version_id,
          unt.created_at AS created_at,
          unt.updated_at AS updated_at,
          'untracked' AS change_id,
          5 AS priority
      		FROM (
      SELECT 'boot_0000000000' AS version_id, 'global' AS ancestor_version_id
      ) AS vi
      		JOIN wanted_versions wv_vi ON wv_vi.version_id = vi.version_id
      		JOIN lix_internal_state_all_untracked unt ON unt.version_id = vi.ancestor_version_id
      		WHERE unt.is_tombstone = 0
      		  AND unt.snapshot_content IS NOT NULL
  ) AS c
) AS w



WHERE w.rn = 1
) AS "lix_internal_state_vtable"
WHERE snapshot_content IS NOT NULL) AS state_by_version
WHERE version_id = 'boot_0000000000') AS state
WHERE file_id = ?
ORDER BY updated_at DESC
LIMIT 20

-- plan --
[
  {
    "id": 2,
    "parent": 0,
    "notused": 0,
    "detail": "CO-ROUTINE w"
  },
  {
    "id": 5,
    "parent": 2,
    "notused": 0,
    "detail": "CO-ROUTINE (subquery-35)"
  },
  {
    "id": 7,
    "parent": 5,
    "notused": 0,
    "detail": "CO-ROUTINE c"
  },
  {
    "id": 8,
    "parent": 7,
    "notused": 0,
    "detail": "COMPOUND QUERY"
  },
  {
    "id": 9,
    "parent": 8,
    "notused": 0,
    "detail": "LEFT-MOST SUBQUERY"
  },
  {
    "id": 12,
    "parent": 9,
    "notused": 0,
    "detail": "MATERIALIZE wanted_versions"
  },
  {
    "id": 14,
    "parent": 12,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 24,
    "parent": 9,
    "notused": 16,
    "detail": "SCAN wv_unt"
  },
  {
    "id": 30,
    "parent": 9,
    "notused": 61,
    "detail": "SEARCH unt USING INDEX ix_unt_v_f_s_e (version_id=? AND file_id=?)"
  },
  {
    "id": 51,
    "parent": 8,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 52,
    "parent": 51,
    "notused": 0,
    "detail": "COMPOUND QUERY"
  },
  {
    "id": 53,
    "parent": 52,
    "notused": 0,
    "detail": "LEFT-MOST SUBQUERY"
  },
  {
    "id": 58,
    "parent": 53,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 64,
    "parent": 53,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_version_descriptor USING INDEX idx_lix_internal_state_cache_v1_lix_version_descriptor_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 88,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 93,
    "parent": 88,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 99,
    "parent": 88,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_stored_schema USING INDEX idx_lix_internal_state_cache_v1_lix_stored_schema_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 123,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 128,
    "parent": 123,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 134,
    "parent": 123,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_key_value USING INDEX idx_lix_internal_state_cache_v1_lix_key_value_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 158,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 163,
    "parent": 158,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 169,
    "parent": 158,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_active_account USING INDEX idx_lix_internal_state_cache_v1_lix_active_account_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 193,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 198,
    "parent": 193,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 204,
    "parent": 193,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_commit USING INDEX idx_lix_internal_state_cache_v1_lix_commit_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 228,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 233,
    "parent": 228,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 239,
    "parent": 228,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_commit_edge USING INDEX idx_lix_internal_state_cache_v1_lix_commit_edge_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 263,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 268,
    "parent": 263,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 274,
    "parent": 263,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_version_tip USING INDEX idx_lix_internal_state_cache_v1_lix_version_tip_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 298,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 303,
    "parent": 298,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 309,
    "parent": 298,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_change_set USING INDEX idx_lix_internal_state_cache_v1_lix_change_set_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 333,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 338,
    "parent": 333,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 344,
    "parent": 333,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_change_set_element USING INDEX idx_lix_internal_state_cache_v1_lix_change_set_element_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 368,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 373,
    "parent": 368,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 379,
    "parent": 368,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_label USING INDEX idx_lix_internal_state_cache_v1_lix_label_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 403,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 408,
    "parent": 403,
    "notused": 216,
    "detail": "SCAN wv_cache"
  },
  {
    "id": 414,
    "parent": 403,
    "notused": 61,
    "detail": "SEARCH lix_internal_state_cache_v1_bench_state_view USING INDEX idx_lix_internal_state_cache_v1_bench_state_view_fv (file_id=? AND version_id=?)"
  },
  {
    "id": 438,
    "parent": 52,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 439,
    "parent": 438,
    "notused": 0,
    "detail": "COMPOUND QUERY"
  },
  {
    "id": 440,
    "parent": 439,
    "notused": 0,
    "detail": "LEFT-MOST SUBQUERY"
  },
  {
    "id": 442,
    "parent": 440,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 443,
    "parent": 442,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 453,
    "parent": 440,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 458,
    "parent": 440,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_version_descriptor USING INDEX idx_lix_internal_state_cache_v1_lix_version_descriptor_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 470,
    "parent": 440,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 489,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 491,
    "parent": 489,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 492,
    "parent": 491,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 502,
    "parent": 489,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 507,
    "parent": 489,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_stored_schema USING INDEX idx_lix_internal_state_cache_v1_lix_stored_schema_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 519,
    "parent": 489,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 538,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 540,
    "parent": 538,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 541,
    "parent": 540,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 551,
    "parent": 538,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 556,
    "parent": 538,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_key_value USING INDEX idx_lix_internal_state_cache_v1_lix_key_value_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 568,
    "parent": 538,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 587,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 589,
    "parent": 587,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 590,
    "parent": 589,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 600,
    "parent": 587,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 605,
    "parent": 587,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_active_account USING INDEX idx_lix_internal_state_cache_v1_lix_active_account_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 617,
    "parent": 587,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 636,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 638,
    "parent": 636,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 639,
    "parent": 638,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 649,
    "parent": 636,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 654,
    "parent": 636,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_commit USING INDEX idx_lix_internal_state_cache_v1_lix_commit_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 666,
    "parent": 636,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 685,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 687,
    "parent": 685,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 688,
    "parent": 687,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 698,
    "parent": 685,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 703,
    "parent": 685,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_commit_edge USING INDEX idx_lix_internal_state_cache_v1_lix_commit_edge_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 715,
    "parent": 685,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 734,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 736,
    "parent": 734,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 737,
    "parent": 736,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 747,
    "parent": 734,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 752,
    "parent": 734,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_version_tip USING INDEX idx_lix_internal_state_cache_v1_lix_version_tip_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 764,
    "parent": 734,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 783,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 785,
    "parent": 783,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 786,
    "parent": 785,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 796,
    "parent": 783,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 801,
    "parent": 783,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_change_set USING INDEX idx_lix_internal_state_cache_v1_lix_change_set_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 813,
    "parent": 783,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 832,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 834,
    "parent": 832,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 835,
    "parent": 834,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 845,
    "parent": 832,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 850,
    "parent": 832,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_change_set_element USING INDEX idx_lix_internal_state_cache_v1_lix_change_set_element_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 862,
    "parent": 832,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 881,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 883,
    "parent": 881,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 884,
    "parent": 883,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 894,
    "parent": 881,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 899,
    "parent": 881,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_lix_label USING INDEX idx_lix_internal_state_cache_v1_lix_label_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 911,
    "parent": 881,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 930,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 932,
    "parent": 930,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 933,
    "parent": 932,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 943,
    "parent": 930,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 948,
    "parent": 930,
    "notused": 27,
    "detail": "SEARCH lix_internal_state_cache_v1_bench_state_view USING INDEX idx_lix_internal_state_cache_v1_bench_state_view_live_vfe (version_id=? AND file_id=?)"
  },
  {
    "id": 960,
    "parent": 930,
    "notused": 216,
    "detail": "SCAN wv_vi"
  },
  {
    "id": 979,
    "parent": 439,
    "notused": 0,
    "detail": "UNION ALL"
  },
  {
    "id": 981,
    "parent": 979,
    "notused": 0,
    "detail": "CO-ROUTINE vi"
  },
  {
    "id": 982,
    "parent": 981,
    "notused": 0,
    "detail": "SCAN CONSTANT ROW"
  },
  {
    "id": 992,
    "parent": 979,
    "notused": 16,
    "detail": "SCAN vi"
  },
  {
    "id": 997,
    "parent": 979,
    "notused": 61,
    "detail": "SEARCH unt USING INDEX ix_unt_v_f_s_e (version_id=? AND file_id=?)"
  },
  {
    "id": 1012,
    "parent": 979,
    "notused": 0,
    "detail": "BLOOM FILTER ON wv_vi (version_id=?)"
  },
  {
    "id": 1024,
    "parent": 979,
    "notused": 53,
    "detail": "SEARCH wv_vi USING AUTOMATIC PARTIAL COVERING INDEX (version_id=?)"
  },
  {
    "id": 1046,
    "parent": 52,
    "notused": 261,
    "detail": "SCAN c"
  },
  {
    "id": 1086,
    "parent": 52,
    "notused": 0,
    "detail": "USE TEMP B-TREE FOR LAST 10 TERMS OF ORDER BY"
  },
  {
    "id": 1123,
    "parent": 51,
    "notused": 241,
    "detail": "SCAN (subquery-35)"
  },
  {
    "id": 1193,
    "parent": 8,
    "notused": 241,
    "detail": "SCAN w"
  },
  {
    "id": 1214,
    "parent": 8,
    "notused": 0,
    "detail": "USE TEMP B-TREE FOR ORDER BY"
  }
]
