aligned with Sergey notes. sql/records.cc: fix for bug #958 - big select with count distinct and group by aligned with Sergey notes.