Re: [SQL] OFFSET impact on Performance???

From: Richard Huxton <dev(at)archonet(dot)com>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: 'Postgresql Performance' <pgsql-performance(at)postgresql(dot)org>
Subject: Re: [SQL] OFFSET impact on Performance???
Date: 2005-01-20 17:04:23
Message-ID: 41EFE497.2070607@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance pgsql-sql

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message William Yu 2005-01-20 17:12:01 Re: PostgreSQL clustering VS MySQL clustering
Previous Message Randolf Richardson 2005-01-20 17:00:51 Re: PostgreSQL vs. Oracle vs. Microsoft

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Fradkin 2005-01-20 17:20:26 Re: ERROR: row is too big: size 9856, maximum size 8136
Previous Message Richard Huxton 2005-01-20 17:01:00 Re: automatic table locking on too many locked records?