Search Postgresql Archives

Re: on update / on delete performance of foreign keys

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

 



"Florian G. Pflug" <fgp@xxxxxxxx> writes:

> when deleting a lot of rows from a large table - and each time it has to find
> referencing tuples by doing an index scan

Are you sure it was even an index scan? And not doing a sequential table scan
for every deletion? In order to do an index scan you need an index on foreign
key columns in the referencing tables, not just the referenced tables. Usually
people only think about the referenced tables because usually that's all they
need. Only when you start cascading updates and deletes do you need indexes on
the columns in the referencing tables. 

-- 
greg


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

[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