Differences between int8 and int4 as pkeys and fkeys

Thomas Swan <tswan@olemiss.edu>

From: Thomas Swan <tswan@olemiss.edu>
To: pgsql-hackers@postgresql.org
Date: 2000-08-04T20:01:20Z
Lists: pgsql-hackers

Attachments

<html><div>Perhaps a little off topic.</div>
<br>
<div>I had been using int8 as primary / foreign keys pairs.&nbsp;&nbsp;
After joining several large tables on the keys, I noticed about a 30/40%
speed improvement just in changing the keys from int8 to int4 data
types.</div>
<br>
Should it affect it that much?
<br>

- <br>
- <b><u>Thomas Swan</b>
<x-tab>&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>
</u>- Graduate Student&nbsp; - Computer Science<br>
- The University of Mississippi<br>
- <br>
- &quot;People can be categorized into two fundamental <br>
- groups, those that divide people into two groups <br>
- and those that don't.&quot;</html>