gpt4 book ai didi

database - 了解 Cloud Spanner INDEX(索引)中的 INTERLEAVE

转载 作者:搜寻专家 更新时间:2023-10-30 19:47:35 25 4
gpt4 key购买 nike

有什么区别

CREATE INDEX SongsBySingerSongName 
ON Songs(SingerId, SongName),
INTERLEAVE IN Singers

CREATE INDEX SongsBySingerSongName 
ON Songs(SingerId, SongName)

最佳答案

Cloud Spanner 会将索引条目与数据表交织在一起。

这意味着每个 SingerId 的 SongsBySingerSongName 索引条目都位于一起。

来自 Spanner > Documentation > Data Definition Language :

Like interleaved tables, entries in an interleaved indexes are stored with the corresponding row of the parent table. See database splits for more details.

When should you create an interleaved index? If the index key that you want to use for index operations matches the key of a table, you might want to interleave the index in that table if the row in the table should have a data locality relationship with the corresponding indexed rows.

关于database - 了解 Cloud Spanner INDEX(索引)中的 INTERLEAVE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42679071/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com