X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id DC4283A4888 for ; Thu, 20 Jan 2005 17:04:48 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 47740-01 for ; Thu, 20 Jan 2005 17:04:38 +0000 (GMT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id 01C853A484F for ; Thu, 20 Jan 2005 17:04:37 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 4.42) id 1CrfiU-000Jfd-3Q; Thu, 20 Jan 2005 17:03:33 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id C75FB170C3; Thu, 20 Jan 2005 17:04:20 +0000 (GMT) Message-ID: <41EFE497.2070607@archonet.com> Date: Thu, 20 Jan 2005 17:04:23 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ron Mayer Cc: 'Postgresql Performance' Subject: Re: [SQL] OFFSET impact on Performance??? References: <019f01c4fee1$1b58d600$0b00a8c0@forge> <41EF9FD3.5020400@archonet.com> <020d01c4fef6$595bb9d0$0b00a8c0@forge> <41EFCC5B.5010302@archonet.com> <41EFE123.9020209@cheapcomplexdevices.com> In-Reply-To: <41EFE123.9020209@cheapcomplexdevices.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.074 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/321 X-Sequence-Number: 10011 Ron Mayer wrote: > Richard Huxton wrote: > >> >> If you've got a web-application then you'll probably want to insert >> the results into a cache table for later use. >> > > If I have quite a bit of activity like this (people selecting 10000 out > of a few million rows and paging through them in a web browser), would > it be good to have a single table with a userid column shared by all > users, or a separate table for each user that can be truncated/dropped? > > I started out with one table; but with people doing 10s of thousand > of inserts and deletes per session, I had a pretty hard time figuring > out a reasonable vacuum strategy. As often as you can, and make sure your config allocates enough free-space-map for them. Unless, of course, you end up I/O saturated. > Eventually I started doing a whole bunch of create table tmp_XXXX > tables where XXXX is a userid; and a script to drop these tables - but > that's quite ugly in a different way. > > With 8.0 I guess I'll try the single table again - perhaps what I > want may be to always have a I/O throttled vacuum running... hmm. Well, there have been some tweaks, but I don't know if they'll help in this case. -- Richard Huxton Archonet Ltd