Re: Mysteriously varying index scan costs

2018-09-24 Thread Laurenz Albe
Pavan Deolasee wrote: > On Mon, Sep 24, 2018 at 2:20 PM, Laurenz Albe > wrote: > > > > But how can it be that the first run has to touch 74917 blocks, > > while whe second run only needs to touch 1185? > > > > The first index scan may have killed lots of index tuples. So the first index scan

Re: Mysteriously varying index scan costs

2018-09-24 Thread Pavan Deolasee
On Mon, Sep 24, 2018 at 2:20 PM, Laurenz Albe wrote: > > > But how can it be that the first run has to touch 74917 blocks, > while whe second run only needs to touch 1185? > > The first index scan may have killed lots of index tuples. Thanks, Pavan -- Pavan Deolasee http://w

Mysteriously varying index scan costs

2018-09-24 Thread Laurenz Albe
Last week I encountered the following at a customer site on PostgreSQL 9.6, and I cannot explain it. The first run gave me this: Index Scan using device_outbound_messages_status on device_outbound_messages (cost=0.43..20.46 rows=97 width=128) (actual time=34.021..35.545 rows=133 loops=1) I