散列和索引有什么区别? [英] What is the difference between hashing and indexing?
问题描述
任何人可以澄清差异?
Hash是一种索引:它可以用于基于键定位记录 - 保留任何记录顺序。基于哈希,不能迭代到后续或前面的元素。但是,这是什么索引(在数据库的上下文中)。
I have studied hashing in DBMS (extensible, linear) and about Indexing in DBMS (sparse, dense, indexes based on secondary key, etc.), but I am unable to understand what the difference is between Hashing and Indexing. Are these two techniques used together or is just either used? I am confused because the purpose of both techniques seem to be to enable us to retrieve the data quickly, so I think either should be sufficient.
Can anyone clarify the difference?
Hash is sort of an index: it can be used to locate a record based on a key -- but it doesn't preserve any order of records. Based on hash, one can't iterate to the succeeding or preceding element. This is however, what index does (in the context of databases.)
这篇关于散列和索引有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!