Home Forums SQL Server 2008 T-SQL (SS2K8) Improving query performance to detect first duplicate RE: Improving query performance to detect first duplicate

  • Dwain.c,

    Thank you for all the effort you put into this.

    I'm still searching for some way to limit the searching for common rows (common sale items or common sale locations) to just the first match, eliminating the need to have to compare all items/locations to determine that a pair of Sales have a common Item at a common Location at the same time (SaleStart/SaleEnd).

    I'm finding that Celko's idea of using EXISTS (select f1.item_id INTERSECT select f2.item_id), can sometimes work better that I initially thought, so I'm currently experimenting more with that technique, but I'm still looking for some other good ideas if anyone has any.

    I'm grateful to you all for helping me with ideas to solve this problem.