Re: Generic Plans for Prepared Statement are 158155 times slower than Custom Plans

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Deepak Somaiya <deepsom(at)yahoo(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, "david(at)kineticode(dot)com" <david(at)kineticode(dot)com>, "Naik, Sameer" <Sameer_Naik(at)bmc(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Generic Plans for Prepared Statement are 158155 times slower than Custom Plans
Date: 2019-05-20 22:16:31
Message-ID: 20190520221631.6i47hwyodfqdk2ym@development
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, May 20, 2019 at 09:37:34PM +0000, Deepak Somaiya wrote:
> wow this is interesting! 
>@Tom, Bruce, David - Experts
>Any idea why would changing the datatype would cause so much degradation - this is even when plan remains the same ,data is same.
>Deepak
> On Friday, May 17, 2019, 2:36:05 AM PDT, Naik, Sameer <Sameer_Naik(at)bmc(dot)com> wrote:
>
>
>Deepak,
>
>I changed the datatype from citext to text and now everything works fine.
>
>The data distribution is same, plan is same, yet there is a huge performance degradation when citext is used instead of text.
>
>However the business case requires case insensitive string handling.
>
>I am looking forward to some expert advice here when dealing with citext data type.
>
>

It's generally a good idea to share explain analyze output for both
versions of the query - both with citext and text.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Walter Smith 2019-05-21 00:43:45 Temporarily very slow planning time after a big delete
Previous Message Deepak Somaiya 2019-05-20 21:37:34 Re: Re: Re: Generic Plans for Prepared Statement are 158155 times slower than Custom Plans