Re: index cost estimation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io>
Cc: Hung Nguyen <hungnq1989(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, "rjuju123(at)gmail(dot)com" <rjuju123(at)gmail(dot)com>
Subject: Re: index cost estimation
Date: 2022-07-06 14:41:29
Message-ID: 2194637.1657118489@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ronan Dunklau <ronan(dot)dunklau(at)aiven(dot)io> writes:
> Looking into it, it looks like we are not charging a cpu "descent" cost for
> the entry tree of the gin index, which we do for the btree index. In general,
> it does not pose a problem since IO costs are far greater than cpu costs. But
> when the index scan is inside a nestloop, we account for cache effect and
> amortize the cost of IO over the number of outer scans, which reduces its
> relative importance significantly. In that case, the index scan on the gin
> index appears much cheaper, as the constant cpu cost is not taken into
> account.

Hm, so it'd seem this probably could happen when comparing *any*
non-btree index to a btree index, because I don't think we are
particularly careful with CPU cost estimation for any of the
other index types. If we do something about this, we probably
have to look at all of them.

regards, tom lane

In response to

  • Re: at 2022-07-06 08:53:52 from Ronan Dunklau

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Ronan Dunklau 2022-07-06 14:52:09 Re: index cost estimation
Previous Message Ronan Dunklau 2022-07-06 08:53:52 Re: