7

As part of a test question, students were asked to define and describe pinning in relation to indexes. When one talks about "pinning" in indexes, what exactly is this? Is there some other word/term I can search for, as google has not provided any solutions.

4

2 回答 2

5

当一个表或索引被固定时,这意味着它被保存在内存中。

数据库分配了一定数量的内存以供使用。通常,数据库缓存最近使用的数据。

当一个索引被pinned时,这意味着该索引被永久保存在内存中,而不是在缓存中被老化。

于 2012-06-01T21:28:56.993 回答
1

在 DBMS 中固定某些内容意味着确保该事物始终保存在内存中。

它经常用于热索引,这些索引会看到很多针对它们的查询,但可能会因数据库缓存老化而不得不从磁盘重新加载。通过将索引固定在内存中,索引扫描理论上永远不需要磁盘访问。

在索引较大的情况下,固定会显着提高性能,因为不需要频繁刷新缓存。

于 2012-10-19T10:38:41.563 回答