散列和索引有什么区别? [英] What is the difference between hashing and indexing?

查看:823
本文介绍了散列和索引有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经研究了DBMS(可扩展,线性)和关于DBMS中的索引(稀疏,密集,基于辅助密钥的索引等)的散列,但我不能理解散列和索引之间的区别是什么。这两种技术是一起使用还是只是使用?我很困惑,因为这两种技术的目的似乎是使我们能够快速检索数据,所以我认为应该是足够了。



任何人可以澄清差异?

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆