Re: Status of tablespaces

From: Sean Chittenden <sean(at)chittenden(dot)org>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: PG Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Status of tablespaces
Date: 2003-02-01 00:10:50
Message-ID: 20030201001050.GG15936@perrin.int.nxad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> > Anyway, the point of my original post is that being able to do
> > stuff like that and have it return near instantly is wonderful
> > when dealing with very large quantities of data. Seriously, try
> > deleting 100M rows without this. With this, it'll happen in less
> > than a second. :)
>
> Without even getting into the index side of things (because I don't
> want to get into a big long explanation here), there's no way it
> could delete all that data that quickly if another table had foreign
> keys referencing it. You have to check *every* other table for
> records matching the ones you're deleting, which at the very least
> means reading all of the ones you're deleting and doing index
> searches or scans on the other tables.

Agreed. With the volume of data necessary to want to use this kind of
a technique, you wouldn't want foreign keys anyway.

> Basically, this looks like PostgreSQL's TRUNCATE, which also ignores
> the FK problems (though it can deal with the indexes, since you just
> delete all of them as well).
>
> Because of this, the technique is usable only in a limited number of
> situations.

But also invaluable in the cases where it is used. :) SQL backed
Cricket/MRTG anyone? -sc

--
Sean Chittenden

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Damon Hart 2003-02-01 00:33:43 backend process crash - PL/pgSQL functions - parsing problem?
Previous Message will trillich 2003-01-31 23:51:50 create view ... select fld,'constant',fld ...