Re: BUG #14302: SQL with LIMIT degrades performance seriously - Mailing list pgsql-bugs

From Kaijiang Chen
Subject Re: BUG #14302: SQL with LIMIT degrades performance seriously
Date
Msg-id CAAkGvS8nLbnCJ2+PpfubVKSoUHaOYd0yBDZ1-2DOVA_Gq+1Uhg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #14302: SQL with LIMIT degrades performance seriously  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: BUG #14302: SQL with LIMIT degrades performance seriously
Re: BUG #14302: SQL with LIMIT degrades performance seriously
List pgsql-bugs
It couldn't solve the problem.
I've already created 2 btree indexes, one for parent_id, the other for
user_id.
Do you mean to create an multi-column index on (parent_id, user_id)? --
still couldn't solve the problem, since we still need index for user_id
(for other sql) and planner will turn to user_id index.

On Wed, Aug 31, 2016 at 1:01 PM, Andrew Gierth <andrew@tao11.riddles.org.uk>
wrote:

> >>>>> "Kaijiang" == Kaijiang Chen <chenkaijiang@gmail.com> writes:
>
>  Kaijiang> Thank you very much for your quick response!
>
>  Kaijiang> So I know I have to deal with my own solutions. Fortunately,
>  Kaijiang> I got the solution with the "WITH" clause:
>
> Why not just create the correct index on each partition?
> (parent_id,user_id)
>
> --
> Andrew (irc:RhodiumToad)
>

pgsql-bugs by date:

Previous
From: Christoph Berg
Date:
Subject: Re: [pgsql-pkg-debian] Re: BUG #14299: initdb and man pages are not installed in the alternatives system
Next
From: Francisco Olarte
Date:
Subject: Re: BUG #14302: SQL with LIMIT degrades performance seriously