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

Re: array_length()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: "Decibel!" <decibel(at)decibel(dot)org>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: array_length()
Date: 2008-11-05 15:15:17
Message-ID: 14206.1225898117@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> There is a tiny problem with this implementation: It returns null for an 
> empty array, not zero.  This is because array_lower and/or array_upper 
> return null for an empty array, which makes sense for those cases.  We 
> could fix this by putting a coalesce around the expression, but since 
> the array functions return null for all kinds of error cases, this might 
> mask other problems.  Or we move to a C implementation.

Basic functionality like this shouldn't be implemented as a SQL function
anyway.  People don't expect that some built-in functions should be
several orders of magnitude slower than other built-in functions of
apparently similar complexity.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2008-11-05 15:16:54
Subject: Re: The suppress_redundant_updates_trigger() works incorrectly
Previous:From: Joshua TolleyDate: 2008-11-05 14:48:50
Subject: Re: Proposed Patch to Improve Performance of Multi-BatchHash Join for Skewed Data Sets

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