{
  "ticket": "U51 #88",
  "status": "passed",
  "startedAt": "2026-10-28T23:50:42.971018+08:00",
  "finishedAt": "2026-10-28T23:50:46.666082+08:00",
  "input": "python3 labs/mysql-engine/run.py u51",
  "exitCode": 0,
  "environment": {
    "os": "macOS-27.2-arm64-arm-64bit",
    "arch": "arm64",
    "python": "3.9.6",
    "mysql": "8.4.7",
    "port": 60942
  },
  "observed": [
    "U51 sessionModel=PASS autocommit=1 isolation=REPEATABLE-READ strict=ON onlyFullGroupBy=ON",
    "U51 constraintFailures=PASS pk=1062/unique=1062/check=3819/notNull=1048/fk=1452/restrict=1451/tooLong=1406",
    "U51 collationConversion=PASS ciEqual=1 csEqual=0 accentInsensitive=1 varcharEqStringCount=1 varcharEqNumberCount=10000 varcharEqNumberFullScan=true",
    "U51 joinAlgorithm=PASS defaultHashJoin=true hashJoinOffStillHashJoin=true indexedJoinUsesNestedLoop=true",
    "U51 aggregation=PASS onlyFullGroupBy=1055 groups=4 windowEqualsGroupBy=true",
    "U51 pagination=PASS samePage=true offsetScanRows=9020 keysetScanRows=20",
    "U51 statistics=PASS actualCommon=9000 actualRare=11 commonFiltered=10.0->90.0 rareFiltered=10.0->0.11 histograms=1",
    "U51 optimizerBoundaries=PASS skipScanUsed=false skipScanChosenPlan=coveringIndexScan invisibleIgnored=true visibleUsed=true",
    "U51 slowLog=PASS queryTime=0.000566 rowsExamined=4651 rowsSent=2000 entries=129",
    "U51 cleanup=PASS ownInstanceRemoved=true port=60942"
  ],
  "checks": [
    {
      "name": "sessionModel",
      "autocommit": "1",
      "isolation": "REPEATABLE-READ",
      "strictMode": true,
      "onlyFullGroupBy": true
    },
    {
      "name": "constraintFailures",
      "primaryKey": {
        "code": "1062",
        "sqlstate": "23000",
        "inTransactionRows": 0
      },
      "unique": {
        "code": "1062",
        "sqlstate": "23000",
        "inTransactionRows": 0
      },
      "check": {
        "code": "3819",
        "sqlstate": "HY000",
        "inTransactionRows": 0
      },
      "notNull": {
        "code": "1048",
        "sqlstate": "23000",
        "inTransactionRows": 0
      },
      "foreignKey": {
        "code": "1452",
        "sqlstate": "23000",
        "inTransactionRows": 0
      },
      "onDeleteRestrict": {
        "code": "1451",
        "sqlstate": "23000"
      },
      "tooLongStrict": {
        "code": "1406"
      }
    },
    {
      "name": "collationAndConversion",
      "ciEquality": "1",
      "csEquality": "0",
      "accentInsensitive": "1",
      "ciCount": "1",
      "indexedPlan": "-> Rows fetched before execution  (cost=0..0 rows=1)",
      "indexedCount": "1",
      "varcharComparedToNumberPlan": "-> Filter: (codes.`code` = 0)  (cost=982 rows=975)\n    -> Table scan on codes  (cost=982 rows=9748)",
      "varcharComparedToNumberCount": "10000"
    },
    {
      "name": "joinAlgorithm",
      "hashJoinPlanHead": "-> Inner hash join (n.order_note = e.code_ref)  (cost=9.99e+6 rows=9.99e+6)",
      "hashJoinUsedByDefault": true,
      "hashJoinOffPlanHead": "-> Inner hash join (n.order_note = e.code_ref)  (cost=9.99e+6 rows=9.99e+6)",
      "indexedJoinPlanHead": "-> Limit: 10 row(s)  (cost=753 rows=10)"
    },
    {
      "name": "aggregation",
      "onlyFullGroupByError": "1055",
      "planHead": "-> Sort: total DESC",
      "windowVsGroupByEqual": true,
      "groups": 4
    },
    {
      "name": "pagination",
      "samePage": true,
      "offsetScanRows": 9020,
      "keysetScanRows": 20,
      "offsetPlan": "-> Limit/Offset: 20/9000 row(s)  (cost=814 rows=20) (actual time=0.981..0.982 rows=20 loops=1)\n    -> Index scan on orders using PRIMARY  (cost=814 rows=9020) (actual time=0.0713..0.859 rows=9020 loops=1)",
      "keysetPlan": "-> Limit: 20 row(s)  (cost=200 rows=20) (actual time=0.017..0.0192 rows=20 loops=1)\n    -> Filter: (orders.id > 9000)  (cost=200 rows=1000) (actual time=0.0167..0.0184 rows=20 loops=1)\n        -> Index range scan on orders using PRIMARY over (9000 < id)  (cost=200 rows=1000) (actual time=0.0161..0.0172 rows=20 loops=1)"
    },
    {
      "name": "statistics",
      "actualRare": 11,
      "actualCommon": 9000,
      "rareFilteredBefore": 10.0,
      "rareFilteredAfter": 0.11,
      "commonFilteredBefore": 10.0,
      "commonFilteredAfter": 90.0,
      "histograms": {
        "tag": 32
      },
      "ordersIndexCardinality": {
        "idx_created": "3",
        "idx_customer_status": "3",
        "idx_status_created": "3",
        "PRIMARY": "3"
      }
    },
    {
      "name": "optimizerBoundaries",
      "skipScanUsed": false,
      "skipScanDefaultPlan": "-> Filter: (orders.`status` = 'PAID')  (cost=0.65 rows=1.33)\n    -> Covering index scan on orders using idx_customer_status  (cost=0.65 rows=4)",
      "skipScanOffPlan": "-> Filter: (orders.`status` = 'PAID')  (cost=0.65 rows=1.33)\n    -> Covering index scan on orders using idx_customer_status  (cost=0.65 rows=4)",
      "invisibleIndexIgnored": true,
      "visibleIndexUsed": true
    },
    {
      "name": "slowLog",
      "fields": {
        "Query_time": "0.000566",
        "Rows_examined": "4651",
        "Rows_sent": "2000"
      },
      "logsEntries": 129,
      "mysqldumpslowHead": "Count: 1  Time=0.06s (0s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost"
    }
  ],
  "limits": [
    "独有 mysqld 实例（8.4.7）在系统临时目录初始化并在结束时删除；不连接 DBngin 3306 实例",
    "单次计时与 EXPLAIN ANALYZE 的 actual time 只作该输入下的观察，不是基准或压测",
    "未运行崩溃恢复/复制/备份迁移（U52）、8.0.39 镜像、生产负载、替代实现（TiDB 等）",
    "slow log 用 long_query_time=0 放大观察，未使用生产慢日志采样策略"
  ],
  "artifacts": {
    "run.py": "faef10a1bd98bfb04e10a8b68b7f9cb2ce5df9a53d3d994715c791ac2e4a2d23",
    "fixtures/u51.sql": "c97a64187a17a860f59b1387220574b7d9af4e79fc51ac12cbca6ac2358d10c1"
  },
  "cleanup": {
    "instanceStopped": true,
    "datadir": "/var/folders/nj/d71mzd2s3hd50q4h30fcsq7r0000gn/T/u51-mysql-7af9vnmn",
    "removed": true
  }
}
