Re: Proposition for better performance

From: Paul Jungwirth <pj(at)illuminatedcomputing(dot)com>
To: hmidi slim <hmidi(dot)slim2(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Proposition for better performance
Date: 2018-03-27 18:36:12
Message-ID: 072ceb55-6b57-7f9d-78a7-308a03bedc55@illuminatedcomputing.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)illuminatedcomputing(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message hmidi slim 2018-03-27 18:42:56 Re: Proposition for better performance
Previous Message Paul Jungwirth 2018-03-27 18:25:30 Re: Proposition for better performance