"Jim C. Nasby" <jim(at)nasby(dot)net> writes:
> project_id | smallint | not null
> explain select * from email_contrib where project_id=8 and id=39622 and
> date='3/1/03';
Cast the constants to smallint, eg
project_id = 8::smallint and ...
or quote them if that feels cleaner to you:
project_id = '8' and ...
or just declare project_id to be integer (hint: the space savings are
completely illusory in this example, anyway, because of alignment
requirements).
See the archives for much prior discussion ;-)
regards, tom lane