Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] having and union in v7beta

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jose Soares <jose(at)sferacarta(dot)com>
Cc: hackers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] having and union in v7beta
Date: 2000-02-29 18:27:41
Message-ID: 239.951848861@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Jose Soares <jose(at)sferacarta(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: The Hermit HackerDate: 2000-02-29 18:34:07
Subject: Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)
Previous:From: Tom LaneDate: 2000-02-29 18:14:34
Subject: Re: [HACKERS] Re: NOT {NULL|DEFERRABLE} (was: bug in 7.0)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group