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

Bruce Momjian wrote:
> Trevor Talbot wrote:
>> On 8/18/07, Bruce Momjian <[EMAIL PROTECTED]> wrote:
>>
>>> Remember an expression index can be a user-created function so you can
>>> embed whatever you want in your function and just index it's output,
>>> just like you would with a trigger creating a separate column.
>> Well, you could create a function that returns a tsvector, but how do
>> you get that to work with queries?  I've been under the impression the
>> expressions need to match (in the normal case, be the same function
>> with the same arguments) in order to use the index.
> 
> Yes, so you create a function called complex_ts and create the index:
> 
>       CREATE INDEX ii on x USING GIT(complex_ts(col1, col2))

GIN?

> 
> and in your WHERE clause you do:
> 
>       WHERE 'a & b' @@ complex_ts(col1, col2)
> 


- --

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564   24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997  http://www.commandprompt.com/
                        UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGxzHtATb/zqfZUUQRAnpFAJ0SXj1hvjxM03l35R3oWpm6TVwKEACeOwup
cfyDu6zdxf1fKcf9AE+5VSs=
=d81X
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to