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

From Sam Mason
Subject Re: select count() out of memory
Date
Msg-id 20071026105824.GB27400@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Re: select count() out of memory  (Thomas Finneid <tfinneid@student.matnat.uio.no>)
Responses Re: select count() out of memory  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
On Fri, Oct 26, 2007 at 08:25:09AM +0200, Thomas Finneid wrote:
> Gregory Stark wrote:
> >Tom's point is that if you have 55k tables then just *finding* the newest
> >child table is fairly expensive. You're accessing a not insignificant-sized
> >index and table of tables. And the situation is worse when you consider the
> >number of columns all those tables have, all the indexes those tables have,
> >all the column keys those indexes the tables have have, etc.
>
> Yes, I got that. But I name the child tables so that I when my server
> receives read requests, I retreive details from the request to be able
> to figure out the exact child table name, without the system needing to
> do any internal searches to find the newest table.

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.

I have a feeling you may have thought about this before, but thought it
wouldn't hurt to point it out more explicitly.


  Sam

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: INDEX and JOINs
Next
From: Reg Me Please
Date:
Subject: Re: INDEX and JOINs