// TODO: Add logic to use an EmptyKeySet if a name doesn't already
// exist in the SymbolTable. This will eliminate the need
// to do a collection scan in those cases where somebody
// typed an element or attribute name incorrectly.
IndexPattern pattern = iq.getPattern();
Indexer idx = context.getIndexManager().getBestIndexer(Indexer.STYLE_NODEVALUE, pattern);
if ( idx != null )
return new NamedKeys(nk.name, nk.attribute, QueryEngine.getUniqueKeys(idx.queryMatches(iq)));
else if ( autoIndex ) {