in reply to Algorithm To Select Lines Based On Attributes

Without knowing more about the data and the rules, I don't think you can get away with comparing each defect with all the rules.

Having said that, if you have many rules of the form "specific_attribute equals X" or "specific_attribute falls between Y and Z", you can preprocess the rule data. For exact matches, build hash; for ranged matches, use something like a segment tree. That would reduce your algorithm from O(A*R) to O((A+R)*log2(R)), where A is the total number of attributes (of all defects together) and R the number of rules.

  • Comment on Re: Algorithm To Select Lines Based On Attributes