简体   繁体   English

如何创建多个 Vitess 索引

[英]How to create multiple Vitess Indexes

Could anyone point out how to change VSchema in Vitess to accommodate multiple VIndexes.谁能指出如何在 Vitess 中更改 VSchema 以适应多个 VIndex。

{
    "sharded": true,
    "tables": {
        "card": {
            "column_vindexes": [
                {
                    "column": [
                        "customerId",
                        "sourceId"
                    ],
                    "name": "hash"
                }
            ]
        }
    },
    "vindexes": {
        "hash": {
            "type": "hash"
        }
    }
}

This file showcases a fairly complex vschema with multiple vindexes: https://github.com/vitessio/vitess/blob/master/examples/demo/schema/user/vschema.json .该文件展示了一个具有多个 vindex 的相当复杂的 vschema: https : //github.com/vitessio/vitess/blob/master/examples/demo/schema/user/vschema.json If you have vitess up and running, you can launch the scripts in the upper directory and play with the demo.如果您已经启动并运行了 vitess,您可以启动上层目录中的脚本并进行演示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM