AW: CTE with JOIN of two tables is much faster than a regular query

From: <kpi6288(at)gmail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: AW: CTE with JOIN of two tables is much faster than a regular query
Date: 2018-08-19 08:59:50
Message-ID: 007301d4379a$fd37a280$f7a6e780$@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Ursprüngliche Nachricht-----
> Von: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kpi6288 2018-08-19 09:07:34 AW: AW: CTE with JOIN of two tables is much faster than a regular query
Previous Message Tim Cross 2018-08-19 02:56:52 Re: AW: CTE with JOIN of two tables is much faster than a regular query