Analyze not doing anything?

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Analyze not doing anything?
Дата
Msg-id 20040205192043.GK32360@nasby.net
обсуждение исходный текст
Ответы Re: Analyze not doing anything?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I build a table to test the theory that PGSQL wouldn't use an index to
satisfy 'SELECT * FROM table WHERE field IS NOT NULL'. Sure enough it
wasn't using the index, but it seems that's because there's no stats to
be had. What am I doing wrong? This is version 7.3.4.

stats=# \t
Showing only tuples.
stats=# select * from pg_stats where tablename='t';

stats=# analyze t;
ANALYZE
stats=# select * from pg_stats where tablename='t';

stats=# select count(*) from pg_stats where tablename='email_contrib';
     5
stats=# \t
Tuples only is off.
stats=# select relname, relpages, reltuples from pg_class where relname ='moo' or relname='t';
 relname | relpages | reltuples
---------+----------+-----------
 moo     |      289 |    131073
 t       |    32769 |    131076
(2 rows)

stats=# \d t
            Table "public.t"
 Column |      Type       |  Modifiers
--------+-----------------+-------------
 i      | integer         |
 c      | character(1950) | default 'x'
Indexes: moo btree (i)

stats=#

--
Jim C. Nasby, Database Consultant                  jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_restore and large files
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Functions in CHECK constraint not getting dumped before