Re: select distinct runs slow on pg 10.6

2019-09-09 Thread yash mehta
Hi Michael/Justin/Flo, Thank you all for your assistance. As Michael said, looks like there are no more tricks left. On Mon, Sep 9, 2019 at 9:09 PM Michael Lewis wrote: > If you can't modify the query, then there is nothing more to be done to > optimize the execution afaik. Distinct is much slo

Re: select distinct runs slow on pg 10.6

2019-09-09 Thread yash mehta
using pk_bls_workflow_states on tbls_workflow_states workflowst9_ (cost=0.14..0.17 rows=1 width=139) (actual time=0.002..0.002 rows=1 loops=1442)" " Index Cond: ((fin_id)::text = (shipmentre0_.shipment_document_status)::text)" " ->

select distinct runs slow on pg 10.6

2019-09-09 Thread yash mehta
We have a query that takes 1min to execute in postgres 10.6 and the same executes in 4 sec in Oracle database. The query is doing 'select distinct'. If I add a 'group by' clause, performance in postgres improves significantly and fetches results in 2 sec (better than oracle). But unfortunately, we

Re: select distinct runs slow on pg 10.6

2019-09-09 Thread yash mehta
#x27;) and (TO_CHAR(shipmentro1_.ARRIVAL_DATE, '-MM-DD') <= '2019-08-29') order by shipmentre0_.SHIPMENT_DATE limit 25 ; On Mon, Sep 9, 2019 at 2:00 PM yash mehta wrote: > We have a query that takes 1min to execute in postgres 10.6 and the same > executes in 4 s