Re: [GENERAL] Index only select count(*)

2013-10-07 Thread Toni Helenius
Ok, from the GUI I checked FULL, FREEZE & ANALYZE. That combination doesn't seem to set the last vacuum date either. So it was wrong for me to use it like that. And auto-vacuum seems to update visibility maps as planned. My mistakes. Sorry about that. Everything seems to work. > > > Wha

Re: [GENERAL] Index only select count(*)

2013-10-07 Thread Toni Helenius
thing? Should auto-vacuum do this? > > What is the plan if you set enable_seqscan = off; in your session? > > Does that give any more insight? > > > > > -Original Message- > > > From: Alban Hertroys [mailto:haram...@gmail.com] > > > Sent: 7.

Re: [GENERAL] Index only select count(*)

2013-10-07 Thread Toni Helenius
> > -----Original Message----- > > From: Alban Hertroys [mailto:haram...@gmail.com] > > Sent: 7. lokakuuta 2013 12:31 > > To: Toni Helenius > > Cc: pgsql-general@postgresql.org > > Subject: Re: [GENERAL] Index only select count(*) > > > > On Oct 7,

Re: [GENERAL] Index only select count(*)

2013-10-07 Thread Alban Hertroys
you last (vacuum) analyzed the table? What is the plan if you set enable_seqscan = off; in your session? Does that give any more insight? > -Original Message- > From: Alban Hertroys [mailto:haram...@gmail.com] > Sent: 7. lokakuuta 2013 12:31 > To: Toni Helenius >

Re: [GENERAL] Index only select count(*)

2013-10-07 Thread Toni Helenius
oops=1)" "Total runtime: 2912.211 ms" -Original Message- From: Alban Hertroys [mailto:haram...@gmail.com] Sent: 7. lokakuuta 2013 12:31 To: Toni Helenius Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Index only select count(*) On Oct 7, 2013, at 11:23, Toni Hel

Re: [GENERAL] Index only select count(*)

2013-10-07 Thread Alban Hertroys
On Oct 7, 2013, at 11:23, Toni Helenius wrote: > The output of analyze: > "Aggregate (cost=18240.50..18240.51 rows=1 width=0)" > " -> Seq Scan on min1_009 (cost=0.00..18108.60 rows=52760 width=0)" That's the output of Explain, not of Explain Analyze. The latter has actual measurements to go

[GENERAL] Index only select count(*)

2013-10-07 Thread Toni Helenius
Hello, I have a table with 961 columns. 1 of the columns is included in a primary key. The table has 52 760 rows. The table size is 137 MB and indexes size is 1176 kB (just the primary key). When I try: SELECT count(*) on it, it uses Seq Scan instead of Index scan. The query takes ~3 seconds. I