Search Postgresql Archives

Re: Ideas to deal with table corruption

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jan 6, 2018, at 12:11 PM, Corey Taylor <corey.taylor.fl@xxxxxxxxx> wrote:
> Is it possible for an index to not exist on those columns?
> 
> https://www.postgresql.org/docs/current/static/ddl-constraints.html#DDL-CONSTRAINTS-FK
> 
> "A foreign key must reference columns that either are a primary key or form a unique constraint. This means that the referenced columns always have an index (the one underlying the primary key or unique constraint); so checks on whether a referencing row has a match will be efficient."

One should also remember that the foreign key itself should usually be indexed, lest a delete on the referenced table require a table scan on the referencing table.

--
Scott Ribe
https://www.linkedin.com/in/scottribe/
(303) 722-0567






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux