From: Trigve Siver <trigves@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Re: slow query execution
Date: Thu, 31 May 2007 01:42:00 -0700 (PDT)
Message-ID: <620846.83344.qm@web52708.mail.re2.yahoo.com> (raw)
Thanks for reply,
This solution looks promising. I'll look at it and test it and let you know.
Thanks once more
Trigve
----- Original Message ----
From: Richard Huxton <dev@archonet.com>
To: Trigve Siver <trigves@yahoo.com>
Sent: Thursday, May 31, 2007 10:33:40 AM
Subject: Re: [SQL] slow query execution
Trigve Siver wrote:
> Hi, thanks for reply
>
> No, I'm working with c++ and libpqxx (pgsql c++ binding). I'm using
> Win32 Listview control with LS_OWNERDATA style. I can use std::map to
> map row_number to ID field but then I must fetch all records from
> that table. This could be ineffective when table has about 10.000+
> records and user want to view/search only first 100 records.
So - you want something like:
The user runs a query ("all blue things") and that gives a list of
results. They can then filter those results further ("shape=round") and
you want to highlight those elements that match.
You either can't or don't want to filter in the application, rather you
would like to run this as two queries but need to match up results from
the second query with the first query (your list).
Suggestion:
For the first query, make sure you have the relevant primary key columns
in your query and do:
CREATE TEMPORARY TABLE my_results AS SELECT ...
Then, you can join against that table in the second query. The temporary
table will exist until you disconnect - see CREATE TABLE for details.
--
Richard Huxton
Archonet Ltd
____________________________________________________________________________________Ready for the edge of your seat?
Check out tonight's top picks on Yahoo! TV.
http://tv.yahoo.com/
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: trigves@yahoo.com
Subject: Re: slow query execution
In-Reply-To: <620846.83344.qm@web52708.mail.re2.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox