Re:
От | Denis Gasparin |
---|---|
Тема | Re: |
Дата | |
Msg-id | 5.1.0.14.0.20010824084809.00a91ec0@10.1.1.2 обсуждение исходный текст |
Ответ на | Re: (Doug McNaught <doug@wireboard.com>) |
Список | pgsql-general |
It contains 50000 records. I have to do vacuum analyze on the table after having issued the "CREATE INDEX" to create the index? Please, let me know... Regards, Denis At 19.03 23/08/01, Doug McNaught wrote: >Denis Gasparin <denis@edinet.it> writes: > > > Hi to all! > > I have created a table using the CREATE TABLE new_table > > (col1,col2,col3) AS SELECT col1,col2,col3 FROM org_table. > > > > I create an index on this table using the statement: > > CREATE UNIQUE INDEX table_idx ON new_table (col1). > > Then i do a select as this: > > SELECT * FROM new_table WHERE col1 = 'value'. > > > > The problem is that when i do an explain this is the query plan: > > > > Seq Scan on new_table (cost=0.00..1116.38 rows=500 width=44)> > > > > Can anyone explain me why it doesn't use the index I have created? > >How populated is the table? If it's small, or if you haven't done >VACUUM ANALYZE, the statistics may end up preferring a sequential >scan. > >-Doug >-- >Free Dmitry Sklyarov! >http://www.freesklyarov.org/ > >We will return to our regularly scheduled signature shortly. > >---------------------------(end of broadcast)--------------------------- >TIP 5: Have you checked our extensive FAQ? > >http://www.postgresql.org/users-lounge/docs/faq.html
В списке pgsql-general по дате отправления: