Re: Proposition for better performance - Mailing list pgsql-general

From Paul Jungwirth
Subject Re: Proposition for better performance
Date
Msg-id 072ceb55-6b57-7f9d-78a7-308a03bedc55@illuminatedcomputing.com
Whole thread Raw
In response to Re: Proposition for better performance  (hmidi slim <hmidi.slim2@gmail.com>)
Responses Re: Proposition for better performance  (hmidi slim <hmidi.slim2@gmail.com>)
List pgsql-general
On 03/27/2018 11:14 AM, hmidi slim wrote:
> Query plan:*
> Bitmap Heap Scan on product_availabilities  (cost=33728.79..236086.04 
> rows=878500 width=26) (actual time=2775.058..5792.842 rows=15000000 loops=1)
>    Recheck Cond: (during @> '[2018-02-01,2018-04-01)'::daterange)
>    Heap Blocks: exact=31040 lossy=79255
>    ->  Bitmap Index Scan on idx_time  (cost=0.00..33509.17 rows=878500 
> width=0) (actual time=2767.262..2767.262 rows=15000000 loops=1)
>          Index Cond: (during @> '[2018-02-01,2018-04-01)'::daterange)
> Planning time: 0.063 ms
> Execution time: 6408.456 ms
> 
> 
> *SELECT product_id, start_date, end_date, during
>      FROM product_availabilities
>      WHERE during @> daterange('2018-02-01', '2018-04-01')*
> *
> returns  query runtime*: 2min
> *

It is 6 seconds or 2 minutes? Where is the 2 minutes number coming from? 
Are you sure that's all Postgres? With 878k rows even sending them over 
the network is going to take a while, and then more time to JSONify them 
or whatever else you need to do.

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com


pgsql-general by date:

Previous
From: Paul Jungwirth
Date:
Subject: Re: Proposition for better performance
Next
From: hmidi slim
Date:
Subject: Re: Proposition for better performance