Indexing, Hashing, and Query
dev.to·18h·
Discuss: DEV

Indexing involves creating a data structure (an index) that stores a small, ordered subset of data from a table, along with pointers to the full data records. When a query is executed, the DBMS can use this index to quickly locate the relevant data without scanning the entire table.

Hashing uses a hash function to directly map data values to their physical storage locations on disk. Instead of traversing an index structure, the hash function calculates the address of the data based on its value.

Create a table

INSERT INTO Students VALUES (101, ‘Arun’, ‘CSBS’, 8.5), (102, ‘Mathan’, ‘ECE’, 8.8), (103, ‘Karthik’, ‘MECH’, 6.9), (104, ‘Hareesh’, ‘CSE’, 9.1), (105, ‘Ravi’, ‘EEE’, 7.2), (106, ‘Srivishal’, ‘CSBS’, 8.8), (107, ‘Vignesh’, ‘IT’, 8.0), (108, ‘Harish’, ’C…

Similar Posts

Loading similar posts...