On Wed, Aug 19, 2015 at 6:08 PM, Kouhei Kaigai <kai...@ak.jp.nec.com> wrote: > Indeed, 6 of 8 grouping keys in this query uses bpchar() data type, so it is > natural comparison function consumed larger portion of CPU cycles. > Do we have any idea to assist these queries by the backend?
With abbreviated keys, char(n) is very significantly slower than varchar(n) (or text). I've been meaning to revisit my docpatch to warn users of this (we already specifically advise against using char(n), more or less). Abbreviation and a few other tricks could easily make an enormous difference. There is no very good reason why the same optimizations that I applied to text could not also be applied to bpchar(), I think. I think that abbreviation could remove much of the special char(n) effort, as well; someone simply needs to do the work. I'm actually more concerned about the problems that this causes for third-party benchmarks than I am about the problems for real users. -- Peter Geoghegan -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers