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

Re: Create index on subfield returned by function that returns base type with sub fields

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Cc: Desmond Coertzen <patrolliekaptein(at)gmail(dot)com>
Subject: Re: Create index on subfield returned by function that returns base type with sub fields
Date: 2010-12-23 17:03:33
Message-ID: 201012231803.33978.andres@anarazel.de (view raw or flat)
Thread:
Lists: pgsql-performance
Hi,

On Thursday 23 December 2010 17:53:24 Desmond Coertzen wrote:
> Is is possible to create an index on a field on a function that returns a
> data type that contains subfields?
> Is this possible? How would I write the statement?
I am not sure I understood you correctly. Maybe you mean something like that:

test=# CREATE FUNCTION blub(IN int, OUT a int, OUT b int) RETURNS record 
IMMUTABLE LANGUAGE sql AS $$SELECT $1+1, $1+2$$;
CREATE FUNCTION
Time: 1.665 ms

test=# CREATE INDEX foo__blub ON foo (((blub(data)).a));
CREATE INDEX
Time: 86.393 ms

Btw, this is the wrong list for this sort of question. The right place would 
be -general.

Andres

In response to

pgsql-performance by date

Next:From: Przemek WozniakDate: 2010-12-23 17:37:53
Subject: concurrent IO in postgres?
Previous:From: Desmond CoertzenDate: 2010-12-23 16:53:24
Subject: Create index on subfield returned by function that returns base type with sub fields

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