Re: Ad-hoc table type?

From: tomas(at)tuxteam(dot)de
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql(at)mohawksoft(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Ad-hoc table type?
Date: 2008-09-29 06:46:31
Message-ID: 20080929064631.GA19449@tomas
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, Sep 28, 2008 at 09:24:48PM -0700, David E. Wheeler wrote:
> On Sep 28, 2008, at 17:46, Tom Lane wrote:
>
>> BTW, I think it is (or should be) possible to create an index on
>> hstore->'mycol', so at least one of the reasons why you should *need*
>> to switch to a "real" database column seems bogus.

[...]

> I'm not sure what that means. Can you create normal btree or hash indexes
> on hstore columns? And is the index useful for both `@>` and `?`?

That means that those operations are supported by a GiST (or GIN) index,
that is:

"find the records where col contains 'foo => 1, bar => 2'"

is supported by the index. Likewise for "is contained in" and "has key".
It's a bit like having mini-indexes on all keys (although I guess not
that efficient). Pretty cool, I'd say.

Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD4DBQFI4HnHBcgs9XrR2kYRAgmiAJ0U9UD8KqX5vLXOGBlW+WwPzzIpEQCY1caS
F4Uug9QD6e0Jw18EvNm28g==
=f8q5
-----END PGP SIGNATURE-----

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2008-09-29 07:05:00 Re: Proposal: move column defaults into pg_attribute along with attacl
Previous Message Oleg Bartunov 2008-09-29 05:04:37 Re: Ad-hoc table type?