To optimize SQL queries, a more precise estimation of the duplicate index selectivity was implemented, which involves knowing how many distinct keys there are in an index allowing duplicates. Counting distinct partial key values on indexes improves the index selectivity calculations and results in overall improved performance of c-treeACE SQL.