Re: How does Index Scan get used
От | Holger Marzen |
---|---|
Тема | Re: How does Index Scan get used |
Дата | |
Msg-id | Pine.LNX.4.44.0202231548170.5817-100000@bluebell.marzen.de обсуждение исходный текст |
Ответ на | Re: How does Index Scan get used ("Samuel J. Sutjiono" <ssutjiono@wc-group.com>) |
Список | pgsql-general |
On Fri, 22 Feb 2002, Samuel J. Sutjiono wrote: [Please answer below cited parts.] > No, I didn't. > > ----- Original Message ----- > From: "Holger Marzen" <holger@marzen.de> > To: "Samuel J. Sutjiono" <ssutjiono@wc-group.com> > Cc: <pgsql-general@postgresql.org> > Sent: Friday, February 22, 2002 10:25 AM > Subject: Re: [GENERAL] How does Index Scan get used > > > > On Fri, 22 Feb 2002, Samuel J. Sutjiono wrote: > > > > > I tried an Index Scan but I kept on getting Seq Scan. Do you know why ? > What do I need to do to get my query to use index scan (I tried to turn it > on by doing SET ENABLE_indexscan = on; but it didn't work) > > > > > > explain select * from test where test_col like 'abc/%'; > > > > > > NOTICE: QUERY PLAN: > > > > > > Seq Scan on test (cost=0.00..22.50 rows=10 width=12) > > > > Did you do a vacuum analyze after creating the index? If you don't do a "vacuum analyze" for a table after creating an index then Postgres has not all the informations to optimize a query. "vaccum analyze" is recommended on a regular basis. I do it every night. -- PGP/GPG Key-ID: http://blackhole.pca.dfn.de:11371/pks/lookup?op=get&search=0xB5A1AFE1
В списке pgsql-general по дате отправления: