Re: mosbench revisited

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: mosbench revisited
Date: 2011-08-11 01:27:08
Message-ID: CA+TgmoYLTNrgxopDyRB1C9czO0XDQ+n+4Po5Wf7Omb8uP6vZeQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2011/8/10 Dimitri Fontaine <dfontaine(at)hi-media(dot)com>:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> However, it doesn't really do anything to solve this problem. The
>> problem here is not that the size of the relation is changing too
>> frequently - indeed, it's not changing at all in this test case. The
>> problem is rather that testing whether or not the size has in fact
>> changed is costing too much.
>
> You were complaining about the cost of the cache maintenance, that in
> the current scheme of things would have to be called far too often.
> Reducing the relation extension trafic would allow, I guess, to have
> something more expensive to reset the cache -- it would not happen much.

That's an interesting point. I confess to having no idea how frequent
relation extension is now, or how much overhead we could add before it
started to get noticeable.

It seems likely to me that we can design something that is
sufficiently lightweight that we don't need to worry about reducing
the relation extension traffic first, but I don't know that for
certain.

>> The reason why we are testing the size of the relation here rather
>> than just using reltuples is because the relation might have been
>> extended since it was last analyzed. We can't count on analyze to run
>> often enough to avoid looking at the actual file size. If the file's
>> grown, we have to scale the number of tuples up proportional to the
>> growth in relpages.
>
> Could we send the same message to the stat collector as autoanalyze is
> doing each time we extend a relation?

Mmm, maybe. I don't really like the idea of getting the stats
collector involved in this; that seems like it will likely add
complexity without any corresponding benefit.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-08-11 01:46:19 Re: mosbench revisited
Previous Message Robert Haas 2011-08-10 23:57:57 Re: wal_sender_delay (WalSndDelay) has served its purpose