VistaDB 6
VistaDB / Developer's Guide / How To Perform Common Tasks / Build and Visualize Foreign Key References / Foreign Key Indexes
In This Topic
    Foreign Key Indexes
    In This Topic

    A frequent discussion topic around Foreign Keys in SQL Server is whether to index the FK column or not.

    In VistaDB we automatically build that index for you when you build a FK on a table and it's not optional.

    Take the previous example Employee and Timesheet example, when an FK is generated on the Timesheets table a new index was built named the same as the FK.  This is built into how VistaDB works, we require the index to be present, you cannot remove the index manually - remove the FK to drop the index.

    Performance Reasons

    Internally the engine requires that this index be built and maintained by the FK table. This allows the Primary Table to store only the rowid of the Index on the FK Table. It results in a smaller file structure, and a faster execution for FK operations.

    See Also