not so smart yet ;)
thickbook:~ gj$ psql gj
Timing is on.
psql (8.4devel)
Type "help" for help.
gj=# create table smartarse(id bigserial, v varchar not null , primary key (id, v));
NOTICE: CREATE TABLE will create implicit sequence "smartarse_id_seq" for serial column "smartarse.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "smartarse_pkey" for table "smartarse"
CREATE TABLE
Time: 172,315 ms
gj=# \d+ smartarse
Table "public.smartarse"
Column | Type | Modifiers | Storage | Description
--------+-------------------+--------------------------------------------------------+----------+-------------
id | bigint | not null default nextval('smartarse_id_seq'::regclass) | plain |
v | character varying | not null | extended |
Indexes:
"smartarse_pkey" PRIMARY KEY, btree (id, v)
Has OIDs: no
gj=# insert into smartarse(v) values('one'), ('two'), ('three'), ('four');
INSERT 0 4
Time: 1,500 ms
gj=# explain select count(*) from smartarse where v is null;
QUERY PLAN
----------------------------------------------------------------
Aggregate (cost=21.62..21.63 rows=1 width=0)
-> Seq Scan on smartarse (cost=0.00..21.60 rows=6 width=0)
Filter: (v IS NULL)
(3 rows)
Time: 1,115 ms
but, getting more and more smart - that's for sure :)