Re: [HACKERS] having and union in v7beta

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] having and union in v7beta
Дата
Msg-id 239.951848861@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] having and union in v7beta  (Jose Soares <jose@sferacarta.com>)
Список pgsql-hackers
Jose Soares <jose@sferacarta.com> writes:
>> But it's tough to believe that that accounts for a 3-to-4x
>> slowdown of this query; certainly I don't see much performance
>> difference on the datatypes I tried.  What datatypes are your fields,
>> anyway?

> 6.5 takes 0.463s
> 7.0 takes 1.640s
> the field type is CHAR(4)

Hmm.  I see no more than a few percent difference between 6.5 and
current.  There's something peculiar going on on your system.

Current code would ultimately invoke strncmp() on the two char fields,
whereas 6.5 used memcmp().  Is it possible that strncmp() is a huge
performance dog on your platform?  I assume you are running in a
non-ASCII locale, which might reduce strncmp's performance, but still...

A quick-and-dirty way for you to check this would be to change the
strncmp call to call memcmp (just the one-word change should work)
in bpchareq() in src/backend/utils/adt/varchar.c, and see if that
changes the performance of this query materially.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Massimo Dal Zotto
Дата:
Сообщение: Re: [HACKERS] Syslog and pg_options (for RPMs)
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)