Re: [HACKERS] Re: [QUESTIONS] Business cases

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: matti(at)algonet(dot)se (Mattias Kregert)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Re: [QUESTIONS] Business cases
Date: 1998-01-20 14:45:33
Message-ID: 199801201445.JAA02244@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>
> Bruce Momjian wrote:
> >
> > > *** Btw, why doesn't PG update statistics when inserting/updating?
> >
> > Too slow to do at that time. You need to span all the data to get an
> > accurate figure.
>
> Is it not possible to take the current statistics and the latest
> changes and calculate new statistics from that?
>
> What information is kept in these statistics? How are they used?
> Obviously this is more than just number of rows, but what exactly?

Look in commands/vacuum.c. It measures the spread-ness of the data, and
there is no way to get this figure on-the-fly unless you maintain
buckets for each range of data values and decrement/increment as values
are added-subtraced. Seeing a the MySQL optimizer is a single file, and
so is the executor, I doubt that is what it is doing. Probably just
keeps a count of how many rows in the table.

--
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message todd brandys 1998-01-20 17:58:12 Re: [HACKERS] Re: New pg_pwd patch and stuff
Previous Message Bruce Momjian 1998-01-20 14:42:12 Re: [HACKERS] Re: Var->sublevels_up