Received: from corporate.fx.ro (corporate.fx.ro [193.231.208.29]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBACARm18223 for ; Mon, 10 Dec 2001 07:10:28 -0500 (EST) (envelope-from marius@wdg.ro) Received: from fx.ro (Beavis.fx.ro [193.231.208.21]) by corporate.fx.ro (8.10.1/8.10.1) with ESMTP id fBACANl25515; Mon, 10 Dec 2001 14:10:23 +0200 Received: from amber.wdg.ro ([193.231.212.69]) by fx.ro (8.10.1/8.10.1) with ESMTP id fBACAJn08340; Mon, 10 Dec 2001 14:10:19 +0200 (EET) Received: from aurora.wdg.ro (IDENT:marius@aurora.wdg.ro [192.168.1.8]) by amber.wdg.ro (8.9.3/8.9.3) with ESMTP id OAA02033; Mon, 10 Dec 2001 14:10:14 +0200 Subject: Re: How to manage search results? From: Marius Andreiana To: Andrew McMillan Cc: pgsql-php In-Reply-To: <1007982394.2311.10.camel@kant.mcmillan.net.nz> References: <1007976478.8206.2.camel@aurora.wdg.ro> <1007978396.2311.6.camel@kant.mcmillan.net.nz> <1007980445.8519.0.camel@aurora.wdg.ro> <1007982394.2311.10.camel@kant.mcmillan.net.nz> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Evolution/0.99.0 (Preview Release) Date: 10 Dec 2001 14:19:05 +0200 Message-Id: <1007986746.8625.0.camel@aurora.wdg.ro> Mime-Version: 1.0 X-Archive-Number: 200112/9 X-Sequence-Number: 784 On Lu, 2001-12-10 at 13:06, Andrew McMillan wrote: > > 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. so for adding/refining/substracting you use in one big query UNION, INTERSECT, EXCEPT instead of a temporary table? Is it ok with your users to run a search which takes say 30 secs, see first 10 results, then wait again 30 secs to see the next 10 ? (if you run the query again...); perhaps I misunderstood something > 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. yes, same here. We have members (about 13000) and staff performs searches with criterias like state of licensure is xx or number of comments > y. (The criterias expand as staff requests) But the data queried doesn't change as often when just browsing through search results, so I'd rather keep a list of IDs in a temporary table than run the query every time they want to see next page. Once one has these results they can go to the individual view of a member and change some data then return to browsing results, or mass-mail everybody in search results. Again, in the mass mail script is faster to start sending mail right away than perform the query (queries) again and then start with the mail. thanks -- Marius Andreiana -- You don't have to go to jail for helping your neighbour http://www.gnu.org/philosophy/