Re: New feature: accumulative functions. - Mailing list pgsql-general

From Pavel Stehule
Subject Re: New feature: accumulative functions.
Date
Msg-id CAFj8pRDHyptp6K4D0L8KmJaSsp8ver51pmHvPY5vR6k5mFxEBA@mail.gmail.com
Whole thread Raw
In response to New feature: accumulative functions.  (pasman pasmański <pasman.p@gmail.com>)
List pgsql-general
2011/9/25 pasman pasmański <pasman.p@gmail.com>:
> This feature give profits for increasing muliti-arg functions. Example:
>
> WHERE f(x,param) = const
>
> it may be impossible to create functional indexes for all params.
>

Sorry, I asked on real use case. Do you know some one?

Pavel


>
>
> 2011/9/25, Pavel Stehule <pavel.stehule@gmail.com>:
>> Hello
>>
>> what is a real use case?
>>
>> Regards
>>
>> Pavel
>>
>> 2011/9/25 pasman pasmański <pasman.p@gmail.com>:
>>> My english is not perfect, by accumulative i think about monotonically
>>> increasing function.
>>>
>>> It works that for clause WHERE f(x)=const:
>>> 1. Read root page of index_on_x and get x1 ... Xn
>>> 2. Calculate f(x1) ... f(xn) for this page
>>> 3. When f(x1)<=const<= f(xn) then x1 <= searched x <= xn and we can
>>> test smaller range (xlower, xgreater).
>>> 4. Otherwise no rows satisfy condition.
>>>
>>> Step 3 we repeat for current index's page and subpages until xlower =
>>> searched x = xgreater
>>>
>>>
>>> 2011/9/25, Tom Lane <tgl@sss.pgh.pa.us>:
>>>> =?ISO-8859-2?Q?pasman_pasma=F1ski?= <pasman.p@gmail.com> writes:
>>>>> I propose to add "accumulative" flag to a function definition. This
>>>>> flag would be set for function f(x) which is accumulative and
>>>>> immutable.
>>>>
>>>> Maybe you'd better define what you mean by "accumulative" ...
>>>>
>>>>> This flag allows to use an index on  x for clauses containing f(x):
>>>>> where f(x) = const
>>>>> where f(x) > const
>>>>
>>>> ... because it's sure not clear how you would get that to work.
>>>>
>>>>                       regards, tom lane
>>>>
>>>
>>>
>>> --
>>> ------------
>>> pasman
>>>
>>> --
>>> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
>>> To make changes to your subscription:
>>> http://www.postgresql.org/mailpref/pgsql-general
>>>
>>
>
>
> --
> ------------
> pasman
>

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: (another ;-)) PostgreSQL-derived project ...
Next
From: pasman pasmański
Date:
Subject: Re: New feature: accumulative functions.