Re: anti-join chosen even when slower than old plan

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>, "Mladen Gogala" <mladen(dot)gogala(at)vmsinfo(dot)com>
Subject: Re: anti-join chosen even when slower than old plan
Date: 2010-11-11 19:47:53
Message-ID: 4CDBF40902000025000375E1@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> I've tried to avoid having the planner need to know the total size
> of the database cluster, but it's kind of hard to avoid that if
> you want to model this honestly.

Agreed. Perhaps the cost could start escalating when the pages to
access hit (effective_cache_size * relation_size / database_size),
and escalate to the defaults (or some new GUCs) in a linear fashion
until you hit effective_cache_size?

> BTW, it seems that all these variants have an implicit assumption
> that if you're reading a small part of the table it's probably
> part of the working set

I would say that the assumption should be that seq_page_cost and
random_page_cost model the costs for less extreme (and presumably
more common) queries, and that we're providing a way of handling the
exceptional, extreme queries.

-Kevin

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2010-11-11 19:50:28 Re: anti-join chosen even when slower than old plan
Previous Message Tom Lane 2010-11-11 19:41:50 Re: anti-join chosen even when slower than old plan