Re: AW: Look at heap_beginscan()

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
Cc: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'PostgreSQL-development'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: AW: Look at heap_beginscan()
Date: 2000-06-08 15:17:22
Message-ID: 200006081517.LAA00775@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > It's certainly something worth looking at, since we've identified
> > > a couple of places like this that are indeed hotspots. But we need
> > > to convince ourselves that other places are also hotspots before
> > > we add overhead in hopes of making those places faster.
> >
> > Are you suggesting that heap scan is faster than index in
> > most of these
> > cases?
>
> Yes, that is what I would guess.
>
> > How many rows does it take for a heap scan to be
> > faster than an
> > index scan?
>
> I would say we can seq read at least 256k before the index starts
> to perform better.
>
> This brings me to another idea. Why do our indexes need at least
> one level ? Why can't we have an index that starts with one leaf page,
> and only if that fills up introduce the first level ?

OK, let's look at pg_type. We have many sequential scans of that table
in a number of places. A row is added to it for every table created by
the user. My question is which tables do we _know_ are a fixed size,
and which vary based on the number of tables/indexes/views installed by
the user. Seems in those cases, we have to use index scans because we
don't know what the size of the table will be. Same with sequential
scans of pg_index, but we already know that is a problem.

Another issue is the use of the cache. If I add cache lookups to
replace some of the sequential scans, I would like to have indexes to
use for cache loads, though I realize some are saying the sequential
scans for cache loads are faster in some cases too.

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2000-06-08 15:41:43 Re: DROP COLUMN status
Previous Message Brian E Gallew 2000-06-08 15:06:39 index idea for system catalogs