Op 5-aug-2007, om 23:14 heeft Aaron Stone het volgende geschreven:
The folks at IC&S coded for 64-bit id numbers very early on. *shrug*
Never considered it to be a problem. Why would it be a severe penalty?
It is because both indexes work better with normal INT, and tables
are better optimized. (In Postgres that is).
This text explains about indexing (copied from http://
www.thescripts.com/forum/thread400290.html)
Postgresql has a really need feature that allows users to define their
own types. Yeah, cool. But, it means that the parser is not much
smarter about coercing an int4 to an int8 than it is about coercing a
custom type (hex, foobar, etc...) from one to another. What this means
too you, the user, is that:
create table test (id int8, info text);
<insert 10,000 rows>
select * from test where id=456;
will result in a sequential scan. Why? Because the default integer type
is int4, and your id field is int8. Cast the value to int8, and watch it
use an index scan:
select * From test where id=cast(456 as int8);
However changing user_id and mailbox_id to INT4 will have the same
resullt!
Marc
_______________________________________________
Dbmail-dev mailing list
Dbmail-dev@dbmail.org
http://twister.fastxs.net/mailman/listinfo/dbmail-dev