Re: select count() out of memory - Mailing list pgsql-general

From Sam Mason
Subject Re: select count() out of memory
Date
Msg-id 20071026144959.GD27400@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: select count() out of memory  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
On Fri, Oct 26, 2007 at 02:21:39PM +0100, Gregory Stark wrote:
> "Sam Mason" <sam@samason.me.uk> writes:
> > I think the lookup that is being referred to is the fact that if you've
> > got 55k (plus) files in a directory then the filesystem still has to
> > perform a search in the directory to locate the actual file associated
> > with the filename.  There probably isn't going to be much difference
> > between the filesystem performing this lookup vs the database descending
> > a few levels of its index structure.
>
> That's true but it's in *addition* to the database having to find the catalog
> records for the table which involves an index lookup itself.
>
> Actually many index lookups since it has to look up the catalog record for the
> table, for all the columns of the table, for all indexes of the table, for all
> the index keys of those indexes, all constraints of the table, all triggers of
> the table, all dependencies on other objects and of other objects on this
> table (this latter is why I suggest not using inheritance).

OK, sounds pretty horrible to contemplate.  If most of the queries
are to the same table (sounds like they will be) then the relavant
information will remain resident in memory won't it?


  Sam

pgsql-general by date:

Previous
From: "Vince Negri"
Date:
Subject: Re: TRUNCATE - timing of the return of disk space - caused by long-lived client?
Next
From: Tino Wildenhain
Date:
Subject: Re: subversion support?