Re: RE: Re: Dissapearing indexes, what's that all about?

From: Daniel ?erud <zilch(at)home(dot)se>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: RE: Re: Dissapearing indexes, what's that all about?
Date: 2001-04-01 16:43:05
Message-ID: 986143385.131zilch@home.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


after a refresh database the explain yields:
index scan using xXxX (cost=0.00..8.14 rows=10 width=147)
after a vacuum + vacuum analyze the explain yields:
seq scan on acc xXxX Ä(cost=0.00..1.23 rows=1 width=147)

humm, seems you are right here... but why is it choosing a
index scan in the first place then?

> What are the costs associated with the EXPLAIN output?
Perhaps a sequential scan is *faster* then an index scan.
>
> Mike Mascari
> mascarm(at)mascari(dot)com
>
> -----Original Message-----
> From: Daniel ?erud [SMTP:zilch(at)home(dot)se]
> Sent: Sunday, April 01, 2001 12:31 PM
> To: pgsql-general(at)postgresql(dot)org
> Subject: Re: Re: [GENERAL] Dissapearing indexes,
what's that all about?
>
>
>
> > >Hey people,
> > >have a very strange problem now...
> > >It's that when my database with the script i'm using a
> > >explain select * from acc where username='britta'
yields
> an
> > >index scan. Very nice. But after some time being up the
> > >same thing yields a SEQUENTIAL scan. What's happening
> > >folks? =) No more than update's select's and vacuums
has
> > >been invoked.
> >
> > Are you doing vacuum or vacuum analyze? I believe only
> the 'vacuum analyze'
> > function cleans up the indexing statistics.
> >
> > len
> >
>
> Please look at this:
> I just ran an interesting little test here...
> watch this:
>
> <DROP DB><CREATE DB><RUN DB SCRIPT>
>
> explain select * from acc where username='britta';
>
> Index scan using acc_username_key on acc...
>
> VACUUM;
>
> explain select * from acc where username='britta';
>
> Seq Scan on acc
>
> <DROP DB><CREATE DB><RUN DB SCRIPT>
>
> explain select * from acc where username='britta';
>
> Index scan
>
> VACUUM ANALYZE
>
> explain select * from acc where username='britta';
>
> Seq scan
>
> What the wakk is goin on here people? =)
>
> version: PostgreSQL 7.0.0 on i686-pc-linux-gnu, compiled
by
> gcc 2.95.2
>
> Thanks
>
> Daniel Akerud
>
>
> ---------------------------(end of broadcast)-------------
--------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

Browse pgsql-general by date

  From Date Subject
Next Message Mike Mascari 2001-04-01 16:43:37 RE: SELECT MAX question
Previous Message ADBAAMD 2001-04-01 16:41:39 Re: Using Indices