Re: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-19 Thread Benoit Tigeot
 :* Chris Hoover *Cc :* pgsql-performance@lists.postgresql.org *Objet :* RE: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT This new index is used but still the read is 230mb. https://explain.dalibo.com/plan/b0f28a9e8a136afd

RE: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-18 Thread msalais
ql.org <mailto:pgsql-performance@lists.postgresql.org> Objet : Re: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT I normally create my indexes to match the where clause of the query. While technically, it should not matter, I find a lot of time, it does. I wou

Re: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-12 Thread Chris Hoover
used but still the read is 230mb. > > https://explain.dalibo.com/plan/b0f28a9e8a136afd > > > De : Chris Hoover > Envoyé : lundi 12 juin 2023 22:55 > À : benoit > Cc : pgsql-performance@lists.postgresql.org > Objet : Re: Forced to use UNION ALL when having multiple A

RE: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-12 Thread benoit
This new index is used but still the read is 230mb. https://explain.dalibo.com/plan/b0f28a9e8a136afd De : Chris Hoover Envoyé : lundi 12 juin 2023 22:55 À : benoit Cc : pgsql-performance@lists.postgresql.org Objet : Re: Forced to use UNION ALL when having

Re: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-12 Thread Chris Hoover
I normally create my indexes to match the where clause of the query. While technically, it should not matter, I find a lot of time, it does. I would create an index on (status, sender_reference, sent_at) and see if the improves your query performance. SELECT * FROM docs WHERE status IN ('dra

RE: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-12 Thread benoit
when having multiple ANY operators and ORDER BY LIMIT On Mon, Jun 12, 2023 at 1:17 PM benoit wrote: > Is there a misusage of my indexes? > > Is there a limitation when using ANY or IN operators and ordered LIMIT behind? It's complicated. Do you find that you get satisfactory perform

Re: Forced to use UNION ALL when having multiple ANY operators and ORDER BY LIMIT

2023-06-12 Thread Peter Geoghegan
On Mon, Jun 12, 2023 at 1:17 PM benoit wrote: > Is there a misusage of my indexes? > > Is there a limitation when using ANY or IN operators and ordered LIMIT behind? It's complicated. Do you find that you get satisfactory performance if you force a bitmap index scan? In other words, what is the e