From: Tom Lane <tgl@sss.pgh.pa.us>
To: Manfred Koizar <mkoi-pg@aon.at>
Cc: shridhar_daithankar@persistent.co.in, pgsql-hackers@postgresql.org, pgsql-general <pgsql-general@postgresql.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: [pgsql-performance] Large databases, performance
Date: Wed, 09 Oct 2002 09:32:50 -0400
Message-ID: <19697.1034170370@sss.pgh.pa.us> (raw)
In-Reply-To: <a2n7qu0qen2ne1chalomdgt5n1etgb4uk3@4ax.com>
References: <3D9C3E05.7070906@clearmetrix.com>
<3DA1A331.21316.F7E742B@localhost>
<a2n7qu0qen2ne1chalomdgt5n1etgb4uk3@4ax.com>
Manfred Koizar <mkoi-pg@aon.at> writes:
> here is an implementation of a set of user types: char3, char4,
> char10.
Coupla quick comments on these:
> CREATE FUNCTION charNN_lt(charNN, charNN)
> RETURNS boolean
> AS '$libdir/fixchar'
> LANGUAGE 'c';
> bool
> charNN_lt(char *a, char *b)
> {
> return (strncmp(a, b, NN) < 0);
> }/*charNN_lt*/
These functions are dangerous as written, because they will crash on
null inputs. I'd suggest marking them strict in the function
declarations. Some attention to volatility declarations (isCachable
or isImmutable) would be a good idea too.
Also, it'd be faster and more portable to write the functions with
version-1 calling conventions.
Using the Makefile to auto-create the differently sized versions is
a slick trick...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, mkoi-pg@aon.at, pgsql-general@postgresql.org, pgsql-performance@postgresql.org
Subject: Re: [pgsql-performance] Large databases, performance
In-Reply-To: <19697.1034170370@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox