It will often occur that we need to search a large character string in a relational database, something like an email address, postal address, etc.
For the most part, when we do such searches, we're searching for a sub-string within that large string of characters.
However, for instances where we know we need an equivalency search, we can make things more efficient by generating a hash of the string and then storing that in an indexed column.
This can be done in all 3 of the major RDBMS platforms. Links below:
MSSQL uses the CHECKSUM() function.
DB2 LUW uses the DBMS_UTILITY.GET_HASH_VALUE() function.
Oracle uses the ORA_HASH function.
This article by Jeff Reinhard over at SQLServerCentral.com is what inspired me to look for the similar function in DB2 & Oracle, and it does a very nice job of explaining the use case for this using an e-mail address scenario.
If anyone knows how to do this in postgressql or MySQL, I'd love to have you add a few words or link in the comments. Thanks! :)
Subscribe to:
Posts (Atom)
Get Restart log using PowerShell
I'm often curious about a restart on a Windows server system. An easy way to get a list of the restart and what initiated it is to use t...
-
Most of what we're going to want to look at when you're having production issues are available through DMV's. If granti...
-
BibleGateway.com - Passage Lookup: John 10:7, 9-10 9I am the gate; whoever enters through me will be saved.[a] He will come in and go out, a...
-
NOTE: These instruction apply to the connections, reports, menus, etc in Oracle SQL Developer. If you are looking to change the font of you...