Skip to content
Advertisement

Tag: database-design

PostgreSQL Index Usage Analysis

Is there a tool or method to analyze Postgres, and determine what missing indexes should be created, and which unused indexes should be removed? I have a little experience doing this with the “profiler” tool for SQLServer, but I’m not aware of a similar tool included with Postgres. Answer I like this to find missing indexes: This checks if there

Database design, which table has the foreign key

I have an Table USER (USER_ID, PASSWORD, NAME, …) and an Table ACCESS_ROLES for the Users, every user can have one ACCESS_ROLE (ONE-TO-ONE). Which table has the Foreign Key? I would put the USER_ID into ACCESS_ROLES table. Is there any best practice approach? Answer Since you will be having a one-to-one relationship, the solution suggested by Philip Kelley is better.

Advertisement