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 [EMAIL PROTECTED] 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?" ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings