Received: from deborah.paradise.net.nz (deborah.paradise.net.nz [203.96.152.32]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBAB6xm06997 for ; Mon, 10 Dec 2001 06:07:00 -0500 (EST) (envelope-from andrew@catalyst.net.nz) Received: from heidegger.catalyst.net.nz (203-96-145-223.adsl.paradise.net.nz [203.96.145.223]) by deborah.paradise.net.nz (Postfix) with ESMTP id 209D4D1A58; Tue, 11 Dec 2001 00:07:01 +1300 (NZDT) Received: from 127.0.0.1 (ident=unknown) by heidegger.catalyst.net.nz with esmtp (MasqMail 0.1.15) id 16DOGY-5Bb-00; Tue, 11 Dec 2001 00:06:34 +1300 Subject: Re: How to manage search results? From: Andrew McMillan To: Marius Andreiana Cc: pgsql-php In-Reply-To: <1007980445.8519.0.camel@aurora.wdg.ro> References: <1007976478.8206.2.camel@aurora.wdg.ro> <1007978396.2311.6.camel@kant.mcmillan.net.nz> <1007980445.8519.0.camel@aurora.wdg.ro> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/1.0 (Preview Release) Date: 11 Dec 2001 00:06:34 +1300 Message-Id: <1007982394.2311.10.camel@kant.mcmillan.net.nz> Mime-Version: 1.0 X-Archive-Number: 200112/8 X-Sequence-Number: 783 On Mon, 2001-12-10 at 23:32, Marius Andreiana wrote: > On Lu, 2001-12-10 at 11:59, Andrew McMillan wrote: > > I just construct my query in the normal way and append a LIMIT ... > > OFFSET ... clause to control the finally select records. > I can't do that. > > Some of the queries I use are complex; after you run a query you > can refine it, add to results, substract from results... I use > a table to build the results from initial query, then add/remove to it > as needed until search is done and finally user starts to > browse the results. I can't make it in one huge query. > > For simple queries your solution is the best, no need for > a table; I assume you just save the query in a session variable. > I also assume your query doesn't take more than a second to run. No, the users can save query criteria and so forth, and queries can take a minute or two to run. The underlying data being queried changes a fair bit. This is a news database, so the users want their queries to stay constant, but the results to vary. For complex (5 or more boolean related keywords) criteria they don't care so much about the minute, it's the results that they want. Perhaps you need to impart a broader understanding of what your application is trying to achieve. I assume from your comments that the data are fairly static, and that the users are analysing it in some way. Cheers, Andrew. -- -------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267