pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: hubert depesz lubaczewski <depesz@depesz.com>
To: Paul van der Linden <paul.doskabouter@gmail.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Slow index creation
Date: Thu, 18 Feb 2021 10:15:53 +0100
Message-ID: <20210218091553.GA25223@depesz.com> (raw)
In-Reply-To: <CAEC-EqCqanUZMG0Y++sb6nKBjsMsZhK6cOVsMjDCGX2G9_64zg@mail.gmail.com>
References: <CAEC-EqBdBNeBd+ssUZbuKPyd4gTE2sjMFEmioSCa=2bsHtJvMA@mail.gmail.com>
	<20210217184808.GA14032@depesz.com>
	<CAEC-EqCqanUZMG0Y++sb6nKBjsMsZhK6cOVsMjDCGX2G9_64zg@mail.gmail.com>

On Wed, Feb 17, 2021 at 08:40:17PM +0100, Paul van der Linden wrote:
> The st_area calculation is done mostly once or sometimes twice for each geom, and I suspect that can't explain the factor 20 slower.
> Creating an index with only one st_area calculation is also done rather quickly.

In this case, make small test case, like 1000 rows, or something like
this. run create index without where, and then remake the functions with
profiling info, for example using this approach:
https://www.depesz.com/2010/03/18/profiling-stored-proceduresfunctions/
and check for yourself what takes this time, and if it's something you
can fix.

Best regards,

depesz






view thread (13+ messages)  latest in thread

Message-ID: <20210218091553.GA25223@depesz.com>
Permalink:  ../20210218091553.GA25223@depesz.com/
Also on:    postgresql.org/message-id/20210218091553.GA25223@depesz.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: depesz@depesz.com, paul.doskabouter@gmail.com
  Subject: Re: Slow index creation
  In-Reply-To: <20210218091553.GA25223@depesz.com>
  References: <CAEC-EqBdBNeBd+ssUZbuKPyd4gTE2sjMFEmioSCa=2bsHtJvMA@mail.gmail.com> <20210217184808.GA14032@depesz.com> <CAEC-EqCqanUZMG0Y++sb6nKBjsMsZhK6cOVsMjDCGX2G9_64zg@mail.gmail.com> <20210218091553.GA25223@depesz.com>

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

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