pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kpi6288@gmail.com
To: pgsql-general@postgresql.org
Subject: AW: CTE with JOIN of two tables is much faster than a regular query
Date: Sun, 19 Aug 2018 10:59:50 +0200
Message-ID: <007301d4379a$fd37a280$f7a6e780$@gmail.com> (raw)
In-Reply-To: <18425.1534606146@sss.pgh.pa.us>
References: <004b01d436d6$ff96c840$fec458c0$@gmail.com>
	<20180818143848.GB3326@tamriel.snowman.net>
	<18425.1534606146@sss.pgh.pa.us>

> -----Ursprüngliche Nachricht-----
> Von: Tom Lane <tgl@sss.pgh.pa.us>
> Gesendet: Samstag, 18. August 2018 17:29
> 
> In any case, given that the ILIKE selects so few rows (and the planner
knows
> it!), finding a way to index that is clearly the right answer.

A trigram index took 9 minutes to build but improved the regular query from
67 seconds down to 500 ms. 

Although this is an impressive improvement, I'm afraid that the index might
create a delays in other parts of the application (INSERT / UPDATE). We will
probably rework the design of this particular table. 

Thanks to everyone who helped me in this matter. 

Regards 

Klaus 





view thread (7+ messages)

Message-ID: <007301d4379a$fd37a280$f7a6e780$@gmail.com>
Permalink:  ../007301d4379a$fd37a280$f7a6e780$@gmail.com/
Also on:    postgresql.org/message-id/007301d4379a$fd37a280$f7a6e780$@gmail.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: kpi6288@gmail.com
  Subject: Re: CTE with JOIN of two tables is much faster than a regular query
  In-Reply-To: <007301d4379a$fd37a280$f7a6e780$@gmail.com>
  References: <004b01d436d6$ff96c840$fec458c0$@gmail.com> <20180818143848.GB3326@tamriel.snowman.net> <18425.1534606146@sss.pgh.pa.us> <007301d4379a$fd37a280$f7a6e780$@gmail.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