include namespace in index query

then namespace is included in the index query now.  
tables with schema names resulted in invalid sql.