next up previous
Next: Index Definition in SQL Up: Indexing & Hashing Previous: Dynamic Hashing

Comparison of Indexing and Hashing

  1. To make a wise choice between the methods seen, database designer must consider the following issues:
  2. The last issue is critical to the choice between indexing and hashing. If most queries are of the form

     aaaaaaaaaaaa¯select  tex2html_wrap_inline1171 
    

    from r

    where tex2html_wrap_inline1175

    then to process this query the system will perform a lookup on an index or hash structure for attribute tex2html_wrap_inline1177 with value c.

  3. For these sorts of queries a hashing scheme is preferable.
  4. However, the worst-case favors indexing:
  5. Index methods are preferable where a range of values is specified in the query, e.g.

     aaaaaaaaaaaa¯select  tex2html_wrap_inline1171 
    

    from r

    where tex2html_wrap_inline1195 and tex2html_wrap_inline1197

    This query finds records with tex2html_wrap_inline1177 values in the range from tex2html_wrap_inline1201 to tex2html_wrap_inline1203 .


next up previous
Next: Index Definition in SQL Up: Indexing & Hashing Previous: Dynamic Hashing

Osmar Zaiane
Mon Jul 13 13:28:03 PDT 1998