Welcome to ModelRight Database Design Tool - Database Modeling Done Right Sign in | Join | Help

Creates FK indexes and deletes redundant indexes

File Details
Downloads: 402 File Size: 6.2kB
Posted By: admin Views: 600
Date Added: Thu, Mar 13 2008

This script is for Oracle, but could easily be adapted for other databases.

It iterates over all tables and creates an FK index if one doesnt already exist and if it wouldnt be redundant.

It also deletes any indexes that are redundant - ie. covered by another index.

It has a couple variables at the beginning of the Evaluate_OnLoad sub that you can set:

DeleteIfPrefixMatches - set to true if you want the index deleted if it matches the prefix of another index.  Otherwise, it needs to match the entire index.

WarnOnly - dont actually delete or create any indexes, just output what it would do.  Of course, even if you do delete indexes, you can always undo the delete.

Comments
No comments exist for this file.

Add Comment

Name (required)
Web Site (optional)
Comment (required)
Add