On November 22, 2019 at 20:28:39, Michael Lewis (mle...@entrata.com) wrote:
I try to avoid DISTINCT and use GROUP BY when feasible, as well as avoiding
OR condition. If you combined anon1 and anon2 with UNION ALL, and did
(inner) join instead of left, or even moved all of that to EXISTS, perhaps
t
I try to avoid DISTINCT and use GROUP BY when feasible, as well as avoiding
OR condition. If you combined anon1 and anon2 with UNION ALL, and did
(inner) join instead of left, or even moved all of that to EXISTS, perhaps
that gives you better consistent performance. Something like this-
SELECT co
On November 21, 2019 at 19:14:33, Pavel Stehule (pavel.steh...@gmail.com)
wrote:
čt 21. 11. 2019 v 17:19 odesílatel Michael Korbakov
napsal:
> Hi everybody.
>
> I stumbled upon a weird problem with the query planner. I have a query
> on a typical EAV schema:
>
> SELECT contacts.id
> FROM conta
čt 21. 11. 2019 v 22:04 odesílatel Michael Korbakov
napsal:
> On November 21, 2019 at 19:14:33, Pavel Stehule (pavel.steh...@gmail.com)
> wrote:
>
>
>
> čt 21. 11. 2019 v 17:19 odesílatel Michael Korbakov
> napsal:
>
>> Hi everybody.
>>
>> I stumbled upon a weird problem with the query planner.
čt 21. 11. 2019 v 17:19 odesílatel Michael Korbakov
napsal:
> Hi everybody.
>
> I stumbled upon a weird problem with the query planner. I have a query
> on a typical EAV schema:
>
> SELECT contacts.id
> FROM contacts
> LEFT OUTER JOIN (SELECT DISTINCT contacts_values.company_id AS
> company_i