Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-11 Thread Patrick B
2017-01-11 4:05 GMT+13:00 Tomas Vondra : > On 01/10/2017 04:05 AM, Patrick B wrote: > >> ​3,581​ individual pokes into the heap to confirm tuple visibility >> and apply the deleted filter - that could indeed take a while. >> David J. >> >> >> I see.. The

Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-10 Thread Tomas Vondra
On 01/10/2017 04:05 AM, Patrick B wrote: ​3,581​ individual pokes into the heap to confirm tuple visibility and apply the deleted filter - that could indeed take a while. David J. I see.. The deleted column is: deleted boolean Should I create an index for that? How could I

Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-09 Thread David G. Johnston
On Mon, Jan 9, 2017 at 8:05 PM, Patrick B wrote: > ​3,581​ individual pokes into the heap to confirm tuple visibility and >> apply the deleted filter - that could indeed take a while. >> David J. > > > I see.. The deleted column is: > > deleted boolean > > Should I

Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-09 Thread Patrick B
> > ​3,581​ individual pokes into the heap to confirm tuple visibility and > apply the deleted filter - that could indeed take a while. > David J. I see.. The deleted column is: deleted boolean Should I create an index for that? How could I improve this query? Does it execute as slowly when

Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-09 Thread David G. Johnston
On Mon, Jan 9, 2017 at 6:06 PM, Patrick B wrote: > *Explain Analyze:* > > CTE Scan on "query_p" "qp" (cost=0.01..1060.57 rows=1 width=8) (actual > time=4065.244..4065.246 rows=1 loops=1) > > CTE query_p > > -> Result (cost=0.00..0.01 rows=1 width=0) (actual

Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-09 Thread David Rowley
On 10 January 2017 at 14:06, Patrick B wrote: > -> Index Scan using "clientid_customers" on "customers" "c" > (cost=0.00..1059.01 rows=607 width=0) (actual time=9.105..4063.728 rows=2513 > loops=1) > Index Cond: ("clientid" =

Re: [GENERAL] Slow index scan - Pgsql 9.2

2017-01-09 Thread Jan de Visser
> > Hi guys, > > I've got the following Query: > > WITH > >query_p AS ( > >SELECT CAST(6667176 AS > BIGINT) AS client_id), > > > > > clients AS ( > >SELECT >

[GENERAL] Slow index scan - Pgsql 9.2

2017-01-09 Thread Patrick B
Hi guys, I've got the following Query: WITH query_p AS ( SELECT CAST(6667176 AS BIGINT) AS client_id), clients AS ( SELECT