Monday, May 16, 2011

SQL Traps

There are some SQL traps that we find. It is important to understand how aggregates in queries may result in incorrect data. You will know how SQL traps can cause queries to return inaccurate results.


Chasm Trap
A chasm trap is a common problem in relational database schemas in which a join path returns more data than expected. A chasm trap is a type of join path between three tables when two many-to-one joins converge on a single table, and there is no context in place that separates the converging join paths.


Fun Trap
Fan traps occur when there is a "one-to-many" join to a table that "fans out" into another "one-to-many" join to another table. This is a common structure and will not normally result in a fan trap. You only get incorrect result from the fan trap when the uery includes a measure object on the middle table of the table path and  an object from the subsequent table.

No comments:

Post a Comment