Matthew Walker wrote: > http://www.houseoffusion.com/cf_lists/index.cfm?method=messages&threadid > =16005&forumid=4 > > Great explanation thanks Jochem. Interested to hear about the dbms > hashing the query and checking if the hash exists as a key to execution > plans.
That was an example, different DBMS'es solve it in different ways. > Is there no risk of two queries being hashed to the same value? There is always a risk, but I think it is quite minimal. > I figure with hashing since you end up with a string of finite length > based on a string of indefinite length that there must be some > duplication of hashes. So I've never used hashes as a key like this > (e.g. when manually building a cache of some data such as XML). Is it > common practice to throw caution to the wind and do this? Very common. In relational databases, it is an accepted joining strategy for varchar fields/multicolumn joins to just take the hash of all the fields involved in the join and join on that. The risk of getting an incorrect result when doing that would be magnitudes larger as the risk of finding the wrong cached exection plan (with the right parameters) because one hashjoin potentially generates millions of hashes. Jochem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Host with the leader in ColdFusion hosting. Voted #1 ColdFusion host by CF Developers. Offering shared and dedicated hosting options. www.cfxhosting.com/default.cfm?redirect=10481 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

