📜  DBMS中的索引编制和哈希处理之间的区别

📅  最后修改于: 2021-08-29 02:36:54             🧑  作者: Mango

1.索引编制
顾名思义,索引是一种通常用于加速数据访问的技术或机制。索引基本上是一种数据结构,用于快速定位和访问数据库表中的数据。使用数据库表的一列或多列可以轻松地开发或创建索引。

2.散列
顾名思义,散列是一种将散列函数与搜索键作为参数结合使用以生成数据记录地址的技术或机制。它无需使用索引结构即可计算磁盘上数据记录的直接位置。一个好的哈希函数仅使用单向哈希算法,并且哈希不能转换回原始密钥。简而言之,这是将给定密钥转换为另一个称为哈希值或简称为哈希的值的过程。

DBMS中的索引编制和哈希处理之间的区别:

Indexing  

Hashing  

It is a technique that allows to quickly retrieve records from database file. It is a technique that allows to search location of desired data on disk without using index structure.  
It is generally used to optimize or increase performance of database simply by minimizing number of disk accesses that are required when a query is processed.  It is generally used to index and retrieve items in database as it is faster to search that specific item using shorter hashed key rather than using its original value.  
It offers faster search and retrieval of data to users, helps to reduce table space, makes it possible to quickly retrieve or fetch data, can be used for sorting, etc.   It is faster than searching arrays and lists, provides more flexible and reliable method of data retrieval rather than any other data structure, can be used for comparing two files for quality, etc.  
Its main purpose is to provide basis for both rapid random lookups and efficient access of ordered records.  Its main purpose is to use math problem to organize data into easily searchable buckets.  
It is not considered best for large databases and its good for small databases.   It is considered best for large databases. 
Types of indexing includes ordered indexing, primary indexing, secondary indexing, clustered indexing. Types of hashing includes static and dynamic hashing.  
It uses data reference to hold address of disk block.  It uses mathematical functions known as hash function to calculate direct location of records on disk.  
It is important because it protects file and documents of large size business organizations, and optimize performance of database. It is important because it ensures data integrity of files and messages, takes variable length string or messages and compresses and converts it into fixed length value.