Re: Another seq scan instead of index question - Mailing list pgsql-general

From Nicholas Piper
Subject Re: Another seq scan instead of index question
Date
Msg-id 20010807192148.M7365@piamox7.haus
Whole thread Raw
In response to Re: Another seq scan instead of index question  (Nicholas Piper <nick@nickpiper.co.uk>)
List 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 by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Admin tool
Next
From: "Eric, Audet"
Date:
Subject: Problems with Blank space