ENH: by prefix is now single pass and not in memory