Re: [SQL] Most efficient way to achieve this ts_query

2008-10-15 Thread Jamie Tufnell
On 10/16/08, Frank Bax <[EMAIL PROTECTED]> wrote: > Jamie Tufnell wrote: >> If someone uses a search query on my site like this: >> >> "abc def" >> >> I would like to return all results for 'abc & def' first, followed by >> all results for tsquery 'abc | def' is there some way to express this >> in

[SQL] Search fields in multiple tables

2008-10-15 Thread Raj Mathur
Hi, I have some information about books spread over multiple tables (title, authors, ISBN, blurb, publisher, etc.) Is there any convenient way in PostgreSQL to allow a user to search these in a single operation? If there is, would there be some way to assign weights to the fields? E.g. a mat

Re: [SQL] Most efficient way to achieve this ts_query

2008-10-15 Thread Frank Bax
Jamie Tufnell wrote: If someone uses a search query on my site like this: "abc def" I would like to return all results for 'abc & def' first, followed by all results for tsquery 'abc | def' is there some way to express this in one tsquery? What's the most efficient way to go about this? The s

[SQL] Most efficient way to achieve this ts_query

2008-10-15 Thread Jamie Tufnell
Hi If someone uses a search query on my site like this: "abc def" I would like to return all results for 'abc & def' first, followed by all results for tsquery 'abc | def' is there some way to express this in one tsquery? What's the most efficient way to go about this? The search is on one col

Re: [SQL] Updating Query of 1 table from data in another

2008-10-15 Thread Scott Marlowe
On Wed, Oct 15, 2008 at 8:16 AM, Chris Preston <[EMAIL PROTECTED]> wrote: > > Thanks scott > Does this work with 8.1 (that's what I'm using) > When I try to create the b table I get a message Yep. Post a self-contained example of what's not working. > ERROR: there is no unique constraint matchin

Re: [SQL] effectiveness tool

2008-10-15 Thread Stefano Buliani
Your best bet is probably EXPLAIN ANALYZE. This should give you a better idea of where the inefficiencies are in your queries. The only way to make it more accurate is, as far as I know, increasing the number of rows postgresql samples from each table during the vacuum. Stefano --