public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ronan Dunklau <[email protected]>
To: Alexander Korotkov <[email protected]>
To: [email protected]
Cc: Tom Lane <[email protected]>
Cc: Michael Paquier <[email protected]>
Cc: [email protected]
Subject: Re: Fix gin index cost estimation
Date: Tue, 06 Dec 2022 11:22:20 +0100
Message-ID: <4787929.31r3eYUQgx@aivenlaptop> (raw)
In-Reply-To: <10184681.nUPlyArG6x@aivenlaptop>
References: <3188617.44csPzL39Z@aivenronan>
	<CAPpHfdtFYZjv41djYjNcJUuZhDKUu9eJSthKmmDWE-azAZjn5g@mail.gmail.com>
	<10184681.nUPlyArG6x@aivenlaptop>

Le vendredi 2 décembre 2022, 13:58:27 CET Ronan Dunklau a écrit :
> Le vendredi 2 décembre 2022, 12:33:33 CET Alexander Korotkov a écrit :
> > Hi, Ronan!
> > Thank you for your patch.  Couple of quick questions.
> > 1) What magic number 50.0 stands for?  I think we at least should make
> > it a macro.
> 
> This is what is used in other tree-descending  estimation functions, so I
> used that too. Maybe a DEFAULT_PAGE_CPU_COST macro would work for both ? If
> so I'll separate this into two patches, one introducing the macro for the
> other estimation functions, and this patch for gin.

The 0001 patch does this.

> 
> > 2) "We only charge one data page for the startup cost" – should this
> > be dependent on number of search entries?

In fact there was another problem. The current code estimate two different 
pathes for fetching data pages: in the case of a partial match, it takes into 
account that all the data pages will have to be fetched. So this is is now 
taken into account for the CPU cost as well. 

For the regular search, we scale the number of data pages by the number of 
search entries.

Best regards,

--
Ronan Dunklau



view thread (15+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Fix gin index cost estimation
  In-Reply-To: <4787929.31r3eYUQgx@aivenlaptop>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox