Re: proposal: searching in array function - array_position

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: 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-01-28 07:15:12
Message-ID: CAFj8pRC63RFJ-UhjrwkHekwtbVQ43A7FEQWMUCXoQAM=Vk0teQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-01-28 0:01 GMT+01:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>:

> On 1/27/15 4:36 AM, Pavel Stehule wrote:
>
>> 2015-01-26 23:29 GMT+01:00 Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com <mailto:
>> Jim(dot)Nasby(at)bluetreble(dot)com>>:
>>
>> On 1/26/15 4:17 PM, Pavel Stehule wrote:
>>
>> Any way to reduce the code duplication between the array and
>> non-array versions? Maybe factor out the operator caching code?
>>
>>
>> I though about it - but there is different checks, different
>> result processing, different result type.
>>
>> I didn't find any readable and reduced form :(
>>
>>
>> Yeah, that's why I was thinking specifically of the operator caching
>> code... isn't that identical? That would at least remove a dozen lines...
>>
>>
>> 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).

I plan to do some benchmark to calculate if we have to do, or we can use
type cache only.

Pavel

>
> --
> Jim Nasby, Data Architect, Blue Treble Consulting
> Data in Trouble? Get it in Treble! http://BlueTreble.com
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2015-01-28 07:16:52 Re: proposal: row_to_array function
Previous Message Heikki Linnakangas 2015-01-28 07:08:13 Re: Parallel Seq Scan