C++ template optimization - for finding rows by using Full Table Scan (or as part of Range Index Scan in strategy Index Only Scan)