Re: Another seq scan instead of index question
От | Nicholas Piper |
---|---|
Тема | Re: Another seq scan instead of index question |
Дата | |
Msg-id | 20010807192148.M7365@piamox7.haus обсуждение исходный текст |
Ответ на | Re: Another seq scan instead of index question (Nicholas Piper <nick@nickpiper.co.uk>) |
Список | pgsql-general |
On Tue, 07 Aug 2001, Nicholas Piper wrote: Replying to myself with some more information. > On Tue, 07 Aug 2001, Tom Lane wrote: > > select attname,attdispersion,s.* > > from pg_statistic s, pg_attribute a, pg_class c > > where starelid = c.oid and attrelid = c.oid and staattnum = attnum > > and relname = 'cdsongs'; > That doesn't look good to me as it contains dodgy bytes... I've removed (hopefully) the nasty entries in my tables by deleting where string is > 'zzzzzz'. The new table which Tom said would be useful is ; attname | attdispersion | starelid | staattnum | staop | stanullfrac | stacommonfrac | stacommonval | staloval | stahival ---------+---------------+----------+-----------+-------+-------------+---------------+---------------+----------+--------------------------- songid | -1 | 61094022 | 1 | 97 | 0 | 2.38796e-07 | 1 | 1 | 4210874 cdid | 4.68083e-06 | 61094022 | 2 | 97 | 0 | 2.3402e-05 | 677 | 1 | 364477 track | 0.0231398 | 61094022 | 3 | 97 | 0 | 0.0860681 | 0 | 0 | 97 song | 0.000651592 | 61094022 | 4 | 1066 | 0 | 0.00321658 | | | zzo, Moderatocon Allegro extt | 0.890565 | 61094022 | 5 | 664 | 0.937465 | 2.98494e-05 | The Residents | | zur Ruhgebracht Unfortunately I'm still getting the same results: depos=# explain select * from cdsongs where lower(song) like 'mushroom festival in hell'; NOTICE: QUERY PLAN: Seq Scan on cdsongs (cost=0.00..103835.24 rows=41877 width=40) EXPLAIN depos=# set enable_seqscan = off; SET VARIABLE depos=# explain select * from cdsongs where lower(song) like 'mushroom festival in hell'; NOTICE: QUERY PLAN: Index Scan using idx_cdsongs_song on cdsongs (cost=0.00..114921.91 rows=41877 width=40) EXPLAIN -- Part 3 MEng Cybernetics; Reading, UK http://www.nickpiper.co.uk/ Change PGP actions of mailer or fetch key see website 1024D/3ED8B27F Choose life. Be Vegan :-) Please reduce needless cruelty + suffering !
В списке pgsql-general по дате отправления: