Re: [pgsql-performance] Large databases, performance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Koizar <mkoi-pg(at)aon(dot)at>
Cc: shridhar_daithankar(at)persistent(dot)co(dot)in, pgsql-hackers(at)postgresql(dot)org, pgsql-general <pgsql-general(at)postgresql(dot)org>, pgsql-performance(at)postgresql(dot)org
Subject: Re: [pgsql-performance] Large databases, performance
Date: 2002-10-09 13:32:50
Message-ID: 19697.1034170370@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-performance pgsql-sql

Manfred Koizar <mkoi-pg(at)aon(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-10-09 13:38:01 Re: Installing PL/Python (progress!)
Previous Message Shridhar Daithankar 2002-10-09 09:24:23 Re: How to find out about index

Browse pgsql-hackers by date

  From Date Subject
Next Message Shridhar Daithankar 2002-10-09 13:41:09 Re: [pgsql-performance] Large databases, performance
Previous Message Samuel A Horwitz 2002-10-09 12:26:26 Re: AIX compilation problems (was Re: Proposal ...)

Browse pgsql-performance by date

  From Date Subject
Next Message Shridhar Daithankar 2002-10-09 13:41:09 Re: [pgsql-performance] Large databases, performance
Previous Message Shridhar Daithankar 2002-10-09 08:25:28 Re: Large databases, performance

Browse pgsql-sql by date

  From Date Subject
Next Message Shridhar Daithankar 2002-10-09 13:41:09 Re: [pgsql-performance] Large databases, performance
Previous Message Adam Witney 2002-10-09 10:32:18 Complex SQL query and performance strategy