will foreign key improve select query performance

------=_Part_3987_2167580.1204863524026
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

If i create foreign key references, whether it will improve the performance
in the select query?


--
With Best Regards,
Petchimuthulingam S

------=_Part_3987_2167580.1204863524026
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

If i create foreign key references, whether it will improve the performance in the select query?<br><br><br>-- <br>With Best Regards,<br>Petchimuthulingam S

------=_Part_3987_2167580.1204863524026--
petchimuthu lingam [ Fr, 07 März 2008 05:18 ] [ ID #1927884 ]

Re: will foreign key improve select query performance

petchimuthu lingam wrote:
> If i create foreign key references, whether it will improve the
> performance in the select query?

Foreign keys are used to create integrity in the database, it won't
affect select performance.

eg:

create table users (
userid int primary key,
username text
);

create table news (
newsid int primary key,
created_by int references users(userid)
);

That means that a news item cannot be created by a userid that doesn't
exist.

http://www.postgresql.org/docs/current/interactive/tutorial- fk.html

--
Postgresql & php tutorials
http://www.designmagick.com/

--
Sent via pgsql-php mailing list (pgsql-php [at] postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-php
dmagick [ Fr, 07 März 2008 05:26 ] [ ID #1927885 ]
Datenbanken » gmane.comp.db.postgresql.php » will foreign key improve select query performance

Vorheriges Thema: join query performance
Nächstes Thema: Need Assistant for XAMPP wit Postgres