Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed. And certainly better than creating bad indices.


I wonder: are there any good rules-of-thumb for when to go ahead and add indices at table-creation time?


Add an index to support foreign key relationships. If you've got a SalesHeader table and a SalesDetail table, you want an index on SalesDetail.SalesHeaderID, especially if you allow cascading deletes from the SalesHeader table.


Projected usage. It can be done, but you have to be an expert basically.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: