[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-116305":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":14,"stars7d":17,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":30,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},116305,"mydb","yzsind\u002Fmydb","yzsind","A high-performance MySQL-compatible database for HTAP and AI agents  Mixed transactional and analytical workloads, with native AI retrieval.","",null,"Rust",102,21,4,34,0,48,29,76.83,"Apache License 2.0",false,"main",[24,25,26,27,28,29],"agent","data","database","mysql","rag","rust","2026-11-23 16:10:49","2026-11-23 18:56:26","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"assets\u002Flogo\u002Fmydb-whale.png\" alt=\"MyDB whale logo with layered database storage\" width=\"256\" height=\"256\">\n\n# MyDB\n\n**A high-performance MySQL-compatible database for HTAP and AI agents**\n\nMixed transactional and analytical workloads, with native AI retrieval.\n\n[English](README.md) · [简体中文](readme_cn.md)\n\n[Download](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Freleases\u002Ftag\u002Fv1.0.1) · [Why MyDB](docs\u002Fwhy-mydb.md) · [Performance evaluation](#performance-evaluation) · [Testing](#testing) · [Quick Start](#quick-start) · [Built for AI Agents](#built-for-ai-agents) · [Documentation](docs\u002FREADME.md) · [MySQL Compatibility](docs\u002Fmysql80-compatibility.md)\n\n\u003C\u002Fdiv>\n\n---\n\nMyDB is a general-purpose database built in Rust for **HTAP (hybrid\ntransactional\u002Fanalytical processing), AI agents, and MySQL compatibility**.\nIt is designed for mixed workloads that combine transactional reads and writes\nwith analytical queries over the same business data. Native full-text and\nvector retrieval and external model calls extend these workflows through\nfamiliar SQL.\n\nApplications can reuse MySQL clients and drivers, while native REST and MCP\ninterfaces give services and agents direct access to the same engine. Automatic\nZone Maps, online schema changes, and directly queryable backups reduce the\nwork needed to tune access, evolve data structures, and inspect earlier data.\n\nMyDB 1.0.1 is a public-preview release intended for feature validation and controlled-environment evaluation.\n\n| Core advantage | What it gives you |\n| --- | --- |\n| **Built for AI agents** | Native vectors, hybrid retrieval, SQL model calls, and REST\u002FMCP access connect agents with business data. |\n| **High-performance HTAP** | Transactional reads and writes alongside analytical queries on one dataset, with parallel execution, vectorization, and automatic Zone Maps. |\n| **MySQL compatible** | Reuse MySQL clients, JDBC drivers, common SQL, and ROW\u002FFULL binlog integration. |\n\nRead [Why MyDB](docs\u002Fwhy-mydb.md) for the application benefits, design choices,\nand published evidence behind these advantages. RRF is a technical preview;\nthe linked references describe each capability's supported scope.\n\n## Performance evaluation\n\n**Over 1 million QPS on 16 CPU cores** — sysbench, November 16, 2026:\n\n| Workload | MyDB QPS | P95 latency |\n| --- | ---: | ---: |\n| `oltp_point_select` | **1,327,407.37** | **0.55 ms** |\n\nThe November 16, 2026 MyDB snapshot ran on a 16-core CPU VM, with 100M rows\nacross 10 tables, 300 client threads on a separate host over the private network, and one\n300-second run using sysbench's `special` access distribution. No errors or\nreconnects were recorded. See the [full benchmark report](docs\u002Fsysbench-100m-300clients-2026-11-16.md)\nfor configuration, methodology, and complete results.\n\n**MyDB vs. MySQL 8.0**, measured November 17, 2026:\n\n| Workload | MyDB | MySQL | Advantage |\n| --- | --- | --- | --- |\n| Point queries · 100M rows, 20 clients | 295,724 queries\u002Fs | 184,108 queries\u002Fs | **1.61x throughput** |\n| Read-only transactions · 100M rows, 20 clients | 13,522 transactions\u002Fs | 7,477 transactions\u002Fs | **1.81x throughput** |\n| TPC-H-derived analytics · SF=10, 22 query medians summed | 50.636 s | 1,205.299 s | **23.80x speedup** |\n| TPC-DS-derived analytics · SF=10, 84\u002F99 matching on MyDB and MySQL | 92.427 s | 4,468.101 s | **48.34x speedup on that subset** |\n| Bulk import · TPC-H SF=10, `LOAD DATA LOCAL INFILE` | 37.281 s | 374.490 s | **10.04x speedup** |\n\nSame 16-vCPU host, 10 GiB database memory limits, and durable commits.\nTPC-DS reports only matching MyDB\u002FMySQL files; its subset differs from the\nhistorical three-engine subset. TPC-derived results are unaudited. See the\n[detailed comparison](docs\u002Fperformance-comparison.md) for results, test\nconditions, result differences, and limitations.\n\n**Cohere 1M HNSW**, November 14, 2026, 768-dimensional FLOAT32 cosine top-100:\n\n| Measurement | MyDB | PostgreSQL 18.6 + pgvector 0.8.7 | Advantage |\n| --- | ---: | ---: | ---: |\n| Search, 1 client | 670 queries\u002Fs | 179 queries\u002Fs | **3.7x throughput** |\n| Search, 16 clients | 5,200 queries\u002Fs | 1,954 queries\u002Fs | **2.7x throughput** |\n| Search p99 latency, 16 clients | 5.6 ms | 14.7 ms | **2.6x lower latency** |\n| Recall@100 | 94.8% | 94.4% | Comparable (+0.4 pp) |\n| HNSW build | 53 s | 118 s | **2.2x speedup** |\n\nThe reported search throughput ratio is 2.7x at 16 clients. Both engines used\nthe same 16-vCPU host,and durable commits. Sources, exact settings, and\nreporting limits are documented in the\n[November 14 Cohere 1M result record](docs\u002Fvector-cohere-1m-hnsw-benchmark-2026-11-14.md).\n\n## Testing\n\n**Over 12,000 automated regression tests and one million fuzz input executions.**\nThe main and Safety CI runs below are from November 17, 2026, at commit\n[`1316cbf4`](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Fcommit\u002F1316cbf40cad563a3c3da0c86cfa3233e820cebf).\n\n| Test area | Verified scope and results | Evidence |\n| --- | --- | --- |\n| Automated regressions | **12,077 passed** across three test partitions. | [CI](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Factions\u002Fruns\u002F44028187611) |\n| SQL functions | **450 function names**, including aliases, have associated tests; 430 names have **1,294 fixture cases**, with dedicated integration tests for the other 20. | [CI](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Factions\u002Fruns\u002F44028187611) |\n| Fuzz testing with AddressSanitizer | **1,065,432 input executions; 14\u002F14 selected targets passed**, out of 15 declared targets. Covers protocol decoding, storage, SQL parsing and expression execution. | [Safety CI and artifacts](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Factions\u002Fruns\u002F44028187290) |\n| Concurrency and fault recovery | **4 Jepsen workloads, 8 crash\u002FCOMMIT-disconnect recovery cases and 16 I\u002FO fault combinations passed**, alongside native replication and semi-sync checks. | [Safety CI](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Factions\u002Fruns\u002F44028187290) |\n\nFault tests check that acknowledged commits survive, unfinished transactions\nleave no partial writes, and recovery preserves consistent data. They use local\nprocesses and injected network or I\u002FO faults. See the [Jepsen](tests\u002Fjepsen\u002FREADME.md)\nand [fuzz](tests\u002Ffuzz\u002FREADME.md) guides for scope and reproduction.\n\nCounts are a snapshot, not line or branch coverage percentages. Function cases\nare included in the regression suite; fuzz executions are not unique test cases.\nThis short fuzz run excluded `sql_execution_differential`, which failed in a\nseparate [November 17 scheduled run in the predecessor repository](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb-archive\u002Factions\u002Fruns\u002F43998686452).\n\n## Quick Start\n\nDownload prebuilt packages for macOS ARM64, Linux x86_64, and Windows x64 from the\n[1.0.1 release page](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Freleases\u002Ftag\u002Fv1.0.1), which also\nincludes SHA256 checksums and platform validation details.\n\n### Run a downloaded binary\n\nDownload the package for your platform, extract it, and open a terminal in the\ndirectory containing the executable. On macOS or Linux, start it with:\n\n```bash\nchmod +x .\u002Fmydb\n.\u002Fmydb --data-dir .\u002Fdata\n```\n\nOn Windows, run the equivalent command in PowerShell:\n\n```powershell\n.\\mydb.exe --data-dir .\u002Fdata\n```\n\nThe server listens on all IPv4 interfaces (`0.0.0.0:8738`) and stores data in `.\u002Fdata`. No Rust\ntoolchain or config file is needed. With a MySQL 8.0 client installed, connect\nfrom another terminal:\n\n```bash\nmysql -h127.0.0.1 -P8738 -uroot -proot test\n```\n\nA fresh data directory includes the `test` database and the local `root` account\nwith password `root`. Run `SELECT 1;` to check the connection. Enter `quit` to\nexit the client, then press **Ctrl+C** in the server terminal to stop it. Restart\nwith the same data directory to reopen your data.\n\n### Native Rust client\n\nBuild the independent client from a source checkout:\n\n```bash\ncargo build --release --locked --manifest-path clients\u002Fmydb-cli\u002FCargo.toml\n.\u002Fclients\u002Fmydb-cli\u002Ftarget\u002Frelease\u002Fmydb-cli -h127.0.0.1 -P8738 -uroot -p test\n```\n\nThe client provides interactive editing and completion, SQL scripts, table\u002FTSV\u002F\nvertical output, TLS, and query cancellation. See the [client manual](docs\u002Fmydb-cli.md).\n\n### Build and connect\n\nInstall Rust 1.95 or newer, a native C toolchain, Perl, and a MySQL 8.0 client;\nthe shell commands below target macOS and Linux.\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb.git\ncd mydb\ncargo build --release --locked --bin mydb\n\nMYDB_DATA_DIR=\u002Ftmp\u002Fmydb\u002Fdata \\\n  .\u002Ftarget\u002Frelease\u002Fmydb --port 8738\n```\n\nWhen the server is ready, connect from another terminal:\n\n```bash\nmysql -h127.0.0.1 -P8738 -uroot -proot test\n```\n\nA fresh data directory creates `root@localhost` with password `root` and a `test`\ndatabase. This account accepts only loopback connections. `MYDB_ROOT_PASSWORD`\nsets the initial password on first start; it does not change existing accounts.\nThe default protocol port is `8738`; override it with `--port`.\n\nTry a write, an aggregate, and a window function:\n\n```sql\nCREATE TABLE orders (\n    id BIGINT PRIMARY KEY,\n    region VARCHAR(32),\n    amount DECIMAL(12, 2)\n);\n\nINSERT INTO orders VALUES\n    (1, 'east', 120.00),\n    (2, 'south', 80.00),\n    (3, 'east', 180.00);\n\nSELECT region,\n       SUM(amount) AS revenue,\n       DENSE_RANK() OVER (ORDER BY SUM(amount) DESC) AS revenue_rank\nFROM orders\nGROUP BY region\nORDER BY revenue_rank, region;\n```\n\n### Docker\n\nPull the prebuilt image from Docker Hub and run a container (stop any local\ninstance using port `8738` first):\n\n```bash\ndocker pull ninedata\u002Fmydb:latest\ndocker volume create mydb-data\n\ndocker run -d --name mydb \\\n  -p 127.0.0.1:8738:8738 \\\n  -v mydb-data:\u002Fvar\u002Flib\u002Fmydb \\\n  -e MYDB_ROOT_PASSWORD='change-me' \\\n  ninedata\u002Fmydb:latest\n\ndocker exec -it mydb mysql -h127.0.0.1 -P8738 -uroot -p --ssl\n```\n\nEnter `change-me` for the password on a fresh volume. Stop with `docker stop\nmydb` and restart with `docker start mydb`; the named volume retains the data.\nBridge\u002FNAT connections through the published port do not match `root@localhost` —\ncreate a dedicated account in that SQL session for host connections. The image\nenables TLS, `fast-alloc`, and the MySQL replication receiver by default.\nSee the [Docker deployment guide](docs\u002Fdocker.md) for certificates, mounted\nconfiguration, cross-architecture builds, and connecting from the host.\n\n### Platforms and distribution\n\nSupported operating systems: macOS (arm64 and Intel) and Linux (x86_64 and\naarch64), plus Windows 11 for foreground operation on local NTFS. See\n[hardware and OS requirements](docs\u002Fhardware-and-os-requirements.md) for\nverification details, Windows limitations, and distribution scope.\n\n## Architecture\n\n![MyDB product architecture: MySQL, optional REST SQL and MCP access; shared SQL engine with online DDL, hybrid retrieval and external AI model calls; native heap storage, Zone Maps, HNSW and IVF; MVCC transactions and time travel; unified memory, sessions, security and metadata; queryable backups, native WAL replication and MySQL ROW\u002FFULL binlog integration](assets\u002Fmydb-architecture.svg)\n\n## REST SQL\n\nAn optional [REST SQL API](docs\u002Frest-api.md) accepts parameterized SQL over\nHTTPS, supports persistent transactions and NDJSON streaming, and shares MySQL\naccounts and permissions. Accounts manage their API keys through SQL over a\nTLS-authenticated MySQL connection.\n\nThe optional [MCP Server](docs\u002Fmcp.md) gives agents native tools to discover\ndatabases and tables, inspect schemas and query plans, execute parameterized\nSQL, and manage sessions. REST and MCP share an HTTP listener and support\nbatches, transactions through persistent sessions, timeouts, and cancellation.\nAPI keys inherit their owning account's current permissions and quotas, so\napplications can use these interfaces without building a separate SQL gateway\nor MCP adapter. Both interfaces are enabled explicitly; HTTPS is the default.\n\n## Built for AI Agents\n\nAn agent's data needs change with every task: add a column, build an index, write embeddings, then join retrieval results back to business data. MyDB combines transactional data, retrieval, and SQL access to external models for retrieval-augmented generation (RAG), knowledge bases, and persistent agent memory.\n\n### Model calls in SQL: generate text and embeddings\n\n- **Text generation**: `AI_GENERATE` accepts a prompt or text message history for summarization, classification, extraction, and answer generation over selected data.\n- **Native embeddings**: `AI_EMBED` returns a FLOAT32 `VECTOR` with validated dimensions. `AI_EMBED_DETAIL` also accepts explicit batches of texts.\n- **Local and remote services**: configure SQL connection and model objects for Ollama, OpenAI Responses, Chat Completions-compatible services, and Embeddings-compatible services. Model weights and inference run outside MyDB.\n- **Structured results**: generation can request JSON Schema output when the configured deployment supports it; MyDB parses and validates the result locally. `_DETAIL` functions expose model revision, provider-reported token usage, timings, and explicit call errors.\n\nOrdinary filtering, joins, sorting, and `LIMIT` run before calls in the final\nSELECT projection, so applications can select the rows to enrich before\ncontacting a model. Calls also support a single `SET @variable = AI_...`\nassignment. See [LLM and embedding calls](docs\u002Fai.md) and the\n[AI function reference](docs\u002Ffunction\u002Fai\u002FREADME.md) for setup and supported SQL contexts.\n\n### Smart indexing: fewer full scans without manual indexes\n\nMyDB enables automatic **Zone Maps** on persistent user tables by default.\nPer-block summaries let eligible scans skip blocks that cannot match a\npredicate, reducing work without requiring a hand-built B-tree index for every\nfiltering pattern. Serial, parallel, and vectorized scans retain final\npredicate checks; missing or untrusted summaries fall back to a regular scan.\nThe benefit depends on data layout and selectivity. See the\n[feature overview](docs\u002Ffeature-overview.md) for the mechanism and fallbacks.\n\n### Online DDL: schemas that evolve with the task\n\nMyDB's heap tables keep row storage separate from indexes, so adding a primary\nkey does not reorganize the heap into a clustered table. Schema versions,\nonline builds, and concurrent change capture reduce interruption during\nsupported schema changes:\n\n- **Online index and primary key creation**: regular and unique B-tree indexes and newly added primary keys allow concurrent DML while being built.\n- **Read-compatible column changes**: adding columns without storage rewrites, compatible type modifications, and some metadata-only changes keep ordinary queries running.\n- **Online column type changes**: supported physical rewrites use shadow storage and incremental catch-up, allowing concurrent reads and writes during the build.\n- **Constraints and charset settings**: online foreign keys, CHECK constraints, and default charset\u002Fcollation metadata changes.\n\nPreparation and publication still require barriers, and some physical rewrites\nand partition operations wait for readers. Supported algorithms and lock modes\ndepend on the operation, types, and indexes. See\n[ALTER TABLE](docs\u002Fstatement\u002Fddl\u002Falter-table.md),\n[online column type changes](docs\u002Fonline-column-type-change.md), and the\n[DDL compatibility boundaries](docs\u002Fmysql80-compatibility.md#table-ddl).\n\n### Native vectors: from storage to large-scale similarity search\n\n- **Native `VECTOR(n, datatype)` type**: FLOAT32 (default), FLOAT16, BFLOAT16, INT8, and BINARY retain their native payloads. Numeric vectors support L2, cosine, and dot-product distance; BINARY supports Hamming and Jaccard. Dimension limits depend on the datatype, from 16,383 for FLOAT32 to 524,256 bits for BINARY.\n- **HNSW and IVF indexes**: both support memory and paged storage. Paged index pages participate in the buffer pool and WAL, allowing index payloads to exceed memory capacity; exact KNN scans are also available.\n- **Explicit quantization**: `WITH (quantization=sq8|sq4|pq|bq)` compresses numeric index payloads, with final re-ranking against visible heap values. The default is `none`; search breadth and re-ranking budgets determine the recall, memory, and latency tradeoff.\n- **Unified SQL**: the optimizer recognizes `ORDER BY distance LIMIT k` and supports parameterized queries; vector writes participate in transaction commit and rollback.\n\nCombined with JSONB, full-text, and structured queries, this supports semantic search, knowledge retrieval, and agent memory. Start with the [vector data and similarity search guide](docs\u002Fvector-search.md), then see [vector datatypes and indexes](docs\u002Fvector-indexes.md) for options, training, limits, and recovery, and the [vector function reference](docs\u002Ffunction\u002Fvector\u002FREADME.md). The current implementation is HNSW \u002F IVF; disk residency does not imply a complete DiskANN implementation.\n\n### Hybrid retrieval: keyword relevance and semantic similarity\n\nMyDB combines [BM25 full-text search](docs\u002Ffulltext-search.md), boolean search,\nand an `ngram` parser with native vector retrieval. The SQL `RRF` expression\nfuses two to eight independently ranked lists using reciprocal rank fusion,\nwith configurable weights and optional per-branch score explanations. Its\nresults can feed ordinary joins, CTEs, aggregation, and window functions.\n\nApplications can apply tenant, authorization, deletion, and model-version\nfilters inside each retrieval branch before its candidate limit, then join the\nfused IDs back to source text and business records. All branches share the\nstatement's transaction view. The [hybrid search guide](docs\u002Fhybrid-search.md)\nincludes Python retrieval examples, optional external reranking, and a\n[LangChain adapter](examples\u002Fpython\u002Fhybrid_langchain.py). RRF is a technical\npreview; retrieval quality depends on the data, models, and candidate windows.\n\n### Governed model access and observable calls\n\n- **Model privileges**: `AI_ADMIN` manages AI objects; `AI_USE` can be granted per model independently of table read privileges.\n- **Encrypted credentials**: API keys are stored as encrypted Secrets. SQL metadata views do not expose decrypted keys; Secret DDL requires TLS.\n- **Bounded execution**: concurrency, queue, memory, request-rate, and output budgets govern model calls. Deadlines and `KILL` cancel local waits, and optional node policies restrict outbound destinations.\n- **Visibility**: `SHOW AI MODELS`, `information_schema.MYDB_AI_RUNTIME_STATUS`, and `_DETAIL` results expose configuration and execution information. `EXPLAIN` shows the external stage without calling a provider; `EXPLAIN ANALYZE` executes it.\n\nModel calls require autocommit outside explicit transactions and are rejected\nin DML, predicates, and persistent schema expressions. Save generated values\nwith a subsequent ordinary write; rollback or cancellation cannot undo work\nalready received by a provider. See the [execution boundaries](docs\u002Fai.md#execution-boundaries)\nand [administration guide](docs\u002Fai.md#administration-and-visibility).\n\n### Try vector retrieval and RETURNING\n\nStill in the `test` database, create a small collection on a `VECTOR` column\ndeclared `NOT NULL`; `RETURNING` gives the inserted IDs directly to the caller:\n\n```sql\nCREATE TABLE agent_notes (\n    id BIGINT PRIMARY KEY,\n    content VARCHAR(128),\n    embedding VECTOR(3) NOT NULL\n);\n\nINSERT INTO agent_notes VALUES\n    (1, 'order summary', STRING_TO_VECTOR('[1,0,0]')),\n    (2, 'shipping details', STRING_TO_VECTOR('[1,1,0]')),\n    (3, 'account settings', STRING_TO_VECTOR('[0,0,2]'))\nRETURNING id;\n\nCREATE INDEX idx_agent_notes_embedding ON agent_notes (embedding)\nUSING HNSW WITH (metric=l2);\n\nSELECT id, content,\n       L2_DISTANCE(embedding, STRING_TO_VECTOR('[1,0,0]')) AS distance\nFROM agent_notes\nORDER BY distance\nLIMIT 2;\n```\n\nThe INSERT returns IDs `1`, `2`, `3`; the query returns the two rows nearest to\n`[1,0,0]` by L2 distance. HNSW provides approximate nearest-neighbor search —\nrecall and performance on larger collections depend on data and parameters. See\n[CREATE INDEX](docs\u002Fstatement\u002Fddl\u002Fcreate-index.md),\n[vector functions](docs\u002Ffunction\u002Fvector\u002FREADME.md), and\n[INSERT RETURNING](docs\u002Fstatement\u002Fdml\u002Finsert.md).\n\nAfter configuring and authorizing `test.local_chat` and `test.local_embed`\nwith the [Ollama setup](docs\u002Fai.md#configure-ollama), try model calls through the\nsame SQL connection:\n\n```sql\nSELECT AI_GENERATE('test.local_chat',\n                   'Explain how semantic search helps an AI agent.') AS answer;\n\nSET @query_embedding = AI_EMBED('test.local_embed', 'shipping details');\nSELECT VECTOR_DIM(@query_embedding) AS embedding_dimensions;\n```\n\nUse that query embedding to search a collection populated with the same model\nrevision and vector dimensions. The three-dimensional vectors in `agent_notes`\nabove are illustrative values and do not share the configured model's embedding space.\n\n## High-performance HTAP\n\nMyDB is designed for HTAP mixed workloads: transactional point lookups,\ninserts, and updates run alongside joins, aggregation, and window queries on\nthe same data. MVCC and locking provide transaction semantics, while the\noptimizer selects execution paths for different query shapes. Parallel\nexecution, data skipping, and unified memory budgets support the analytical\nwork within that mixed workload.\n\n| Design | Capability |\n| --- | --- |\n| **Transactional storage** | Heap tables, B-trees, MVCC, row locks, WAL, undo, and crash recovery, with SAVEPOINT and XA two-phase commit. |\n| **Cost-based optimizer** | Chooses access paths, join orders, and join algorithms from statistics and a cost model. |\n| **Parallel hash join** | Uses multiple cores for joins, scans, and aggregation on complex analytical SQL. |\n| **Vectorized execution and SIMD** | Processes data in batches, cutting per-row dispatch and computation overhead on suitable paths. |\n| **Automatic scan reduction** | Combines zone maps, partition pruning, predicate pushdown, projection pruning, and covering indexes. |\n| **Unified memory management** | Coordinates the buffer pool, caches, and executor budgets; sort and hash-join operators spill to disk. |\n\nQuery capabilities include CTEs, recursive CTEs, subquery decorrelation, set operations, window functions, and `ROLLUP` \u002F `CUBE` \u002F `GROUPING SETS`. See [optimizer and operators](docs\u002Foptimizer-and-operators.md), and [MVCC and locking](docs\u002Fmvcc-and-locking.md).\n\n## MySQL compatible\n\n**Reuse the connection methods and SQL your application already knows.**\n\n- **Clients and drivers**: MySQL classic protocol is supported, so the MySQL CLI, Connector\u002FJ, and other clients work; prepared statements, binary result sets, and read-only server-side cursors are included.\n- **Core SQL**: common DDL, DML, transactions, queries, functions, and privilege management are covered. Whether a given application needs no changes should be verified against your actual SQL and transaction semantics.\n- **binlog ecosystem**: MyDB can act as a MySQL binlog source or replication receiver, and downstream sync tools built on supported binlog events can ingest from it. Only **ROW\u002FFULL** images are supported; SBR\u002FMIXED and MINIMAL are not.\n\nThe full coverage map, transactional differences, and unsupported features are listed in the [MySQL 8.0 compatibility matrix](docs\u002Fmysql80-compatibility.md).\n\n## Practical extensions beyond MySQL\n\n| Feature | Use |\n| --- | --- |\n| **FULL OUTER JOIN** | Compare datasets while retaining unmatched rows from both sides. |\n| **CUBE \u002F GROUPING SETS** | Compute several levels of aggregation in one query. |\n| **Window GROUPS \u002F EXCLUDE** | Express additional window frame and exclusion rules. |\n| **Wider TIMESTAMP range** | Supports dates beyond 2038, up to year 9999. |\n| **Sequences** | Standalone sequence objects with `NEXTVAL`, `CURRVAL`, and friends. |\n| **DML `RETURNING` with OLD \u002F NEW** | Return modified rows directly, saving follow-up queries; multi-target restrictions apply. |\n| **`generate_series()`** | Integer, decimal, and datetime series for time axes, gap filling, and data generation. |\n| **TABLESAMPLE** | Explore data with row\u002Fpage sampling, percentage or exact row counts, and repeatable samples. |\n| **B-tree INCLUDE** | Cover query columns without adding them to the search key. |\n| **`CREATE OR REPLACE` routines** | Replace procedure and function definitions while preserving routine grants. |\n| **SQL ROWID** | Locate heap rows directly; physical addresses can be reused. |\n\nSee the [SQL capability map](docs\u002Fmysql80-compatibility.md#select-capabilities),\n[DML RETURNING](docs\u002Fdml-returning.md), [sequences](docs\u002Fsequences.md),\n[series generation](docs\u002Fgenerate-series.md), and [SQL ROWID](docs\u002Frowid.md).\n\n## Data protection and native replication\n\nMyDB combines recovery with direct SQL inspection, giving operators and agents\nmore ways to investigate earlier data before restoring an entire instance.\n\n| Capability | What it gives you |\n| --- | --- |\n| [Recycle bin](docs\u002Frecycle-bin.md) | Query and restore retained tables after eligible DROP or TRUNCATE operations, including tables removed by DROP DATABASE. |\n| [Time travel](docs\u002Fmysql80-compatibility.md#time-travel-queries) | Query and join historical data with `FOR SYSTEM_TIME AS OF` within the retained history window. |\n| [Direct backup queries](docs\u002Fbackup-and-recovery.md) | Open a sealed physical base read-only without copying the whole database or replaying WAL. |\n| [Online backup and PITR](docs\u002Fbackup-and-recovery.md) | Capture a full instance baseline, archive subsequent WAL, verify recovery inputs, and restore by time or LSN. |\n| [Native WAL replication](docs\u002Fnative-replication.md) | Maintain a MyDB standby independently of MySQL binlog, with asynchronous or semi-synchronous replication and controlled role changes. |\n\nThe recycle bin defaults to a seven-day retention target, subject to expiration\nand disk-pressure reclamation; triggers, foreign keys, row policies, and grants\nare not restored with the table. WAL archiving is enabled separately from a full\nbackup. Native role changes require external fencing of the former primary.\n\nUnified memory accounting, query budgets, cache reclamation, and spill-capable\noperators help manage resource use across these workloads. `SHOW MYDB MEMORY`,\n`SHOW MYDB MEMORY SESSIONS`, and `SHOW ENGINE MYDB STATUS` expose memory and\nengine diagnostics. See [memory configuration](docs\u002Fconfiguration-resources.md)\nand [MVCC and locking](docs\u002Fmvcc-and-locking.md) for resource and concurrency\nbehavior.\n\n## Compatibility boundaries\n\n- **MySQL compatibility has explicit scope**: the classic protocol is supported, X Protocol is not; the native storage engine is not file- or plugin-ABI-compatible with InnoDB.\n- **Transaction semantics differ**: the default isolation level is `READ COMMITTED`; `REPEATABLE READ` intentionally uses MVCC snapshot isolation without InnoDB gap\u002Fnext-key locks to avoid range-lock contention, insert blocking, and the associated deadlock patterns. `SERIALIZABLE` range-insert prevention uses table-level shared locks. See [MVCC and locking](docs\u002Fmvcc-and-locking.md#snapshot-lifecycle-and-isolation-levels) for the design and semantic boundaries.\n- **Replication has prerequisites**: MySQL → MyDB replication is built into every server build and requires ROW\u002FFULL binlog on the source; native physical replication uses controlled, manual role switching with no automatic leader election.\n- **Time travel has a window**: table-level `FOR SYSTEM_TIME AS OF` depends on undo retention settings, and the default retention window is `0`; queries across schema DDL boundaries are explicitly rejected.\n\nUnimplemented SQL or protocol capabilities return clear errors rather than failing silently. The detailed scope is defined by the [compatibility matrix](docs\u002Fmysql80-compatibility.md), the source, and the tests.\n\n## Documentation\n\n| Entry point | Contents |\n| --- | --- |\n| [Why MyDB](docs\u002Fwhy-mydb.md) | HTAP mixed workloads, AI capabilities, application benefits, and performance evidence |\n| [Documentation index](docs\u002FREADME.md) | Product, SQL, operations, and implementation docs |\n| [Feature overview](docs\u002Ffeature-overview.md) | Capability map and implementation boundaries |\n| [AI model calls](docs\u002Fai.md) \u002F [Hybrid search](docs\u002Fhybrid-search.md) | Model setup, embeddings, generation, permissions, and retrieval fusion |\n| [SQL statements](docs\u002Fstatement\u002FREADME.md) \u002F [Functions](docs\u002Ffunction\u002FREADME.md) | Syntax, semantics, and usage examples |\n| [Configuration guide](docs\u002Fconfiguration.md) \u002F [Config template](mydb.cnf.example) | Startup options, environment variables, and runtime settings |\n| [Data directory and recovery](docs\u002Fstorage-format.md) | File roles, format compatibility, durability, and crash recovery |\n\nProduct documentation under `docs\u002F` is written in English. When documentation\nand behavior disagree, the source code and tests are authoritative; the\ncompatibility matrices describe the documented scope.\n\n## Reporting issues\n\nSubmit bug reports through [GitHub Issues](https:\u002F\u002Fgithub.com\u002Fyzsind\u002Fmydb\u002Fissues).\nFollow the [issue reporting guide](docs\u002Freporting-issues.md) and include the exact\nMyDB version, operating system, relevant logs, and reproducible steps and scripts.\n\nMyDB is licensed under the [Apache License 2.0](LICENSE).\n","MyDB 是一个高性能、MySQL 兼容的 HTAP 数据库，专为混合事务与分析负载及 AI 代理场景设计。核心功能包括原生向量与全文检索、SQL 内联调用外部 AI 模型、REST\u002FMCP 接口直连 AI 代理、自动 Zone Maps 加速查询、在线 Schema 变更及可直接查询的备份。基于 Rust 构建，支持标准 MySQL 协议与 SQL 语法，复用现有客户端和 JDBC 驱动。适用于需要实时交易处理+即席分析+AI 增强检索的一体化数据服务场景，如智能客服后台、RAG 应用数据层、AI agent 运行时存储等。",2,"2026-11-24 04:53:30","CREATED_QUERY"]