Re: proposal: searching in array function - array_position

From: Petr Jelinek <petr(at)2ndquadrant(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: searching in array function - array_position
Date: 2015-02-22 02:00:54
Message-ID: 54E93856.6070701@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28/01/15 08:15, Pavel Stehule wrote:
>
>
> 2015-01-28 0:01 GMT+01:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com
> <mailto:Jim(dot)Nasby(at)bluetreble(dot)com>>:
>
> On 1/27/15 4:36 AM, Pavel Stehule wrote:
>
>
> It is only partially identical - I would to use cache for
> array_offset, but it is not necessary for array_offsets ..
> depends how we would to modify current API to support externally
> cached data.
>
>
> Externally cached data?
>
>
> Some from these functions has own caches for minimize access to typcache
> (array_map, array_cmp is example). And in first case, I am trying to
> push these information from fn_extra, in second case I don't do it,
> because I don't expect a repeated call (and I am expecting so type cache
> will be enough).
>

You actually do caching via fn_extra in both case and I think that's the
correct way, and yes that part can be moved common function.

I also see that the documentation does not say what is returned by
array_offset if nothing is found (it's documented in code but not in sgml).

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2015-02-22 02:14:55 Re: PATCH: decreasing memory needlessly consumed by array_agg
Previous Message Peter Geoghegan 2015-02-22 01:59:17 Abbreviated keys for text cost model fix