Quick Start
Connect to MySQL
HTTP Tunnel
SSH Tunnel
Databases
Schema
Tables
Adding Fields and Choosing Data Types
Customising Fields
Primary Keys and Indexes
Filter Wizard
Foreign Keys
Foreign Keys Data Selection
Uniques and Checks
Rules and Triggers
Privileges
Import/Export
Function
View
Tablespace
Cast
Language
Aggregate
Conversion
Domain
Trigger Function
Operator
Operator Class
Sequence
Type
Queries
Visual Query Builder
Data
Manage Users
Backup
Data Transfer
Schedule
Server Monitor
Data Synchronization
Structure Synchronization
Console
Virtual Grouping
Maintaining your databases/tables
Preferences
General
Tabs
Tables
Queries
  Working with Primary Keys and Indexes
 

Set or change the primary key

  1. Open your table in the Table Design Window
  2. Select the Fields tab
  3. Identify the field(s) or insert new field(s) that must be part of the primary key
  4. Click Primary Key button
  5. Click Save or Save As from the toolbar when you are ready to save the table

NOTE: All the fields that must be part of the primary key may not allow Null values

Remove the primary key

  1. Open your table in the Table Design Window
  2. Select the Fields tab
  3. Identify the field(s) that is part of the primary key
  4. Click Primary Key button
  5. Click Save or Save As from the toolbar when you are ready to save the table

Create an index to find and sort records faster

You can index a single field or a combination of fields so that you sort and find records more quickly.

Create a single-field index

  1. Open the table in Design View
  2. Select the Indexes tab
  3. To add a new index definition, click Add Index from the toolbar
  4. In the Index Name column enter the name of the index
  5. Double-click on the Field(s) Name grid
  6. To add a field for the index, enter the field name to the grid
  7. Click Save or Save As from the toolbar when you are ready to save the table

Create a multiple-field index

  1. Open the table in Design View
  2. Select the Indexes tab
  3. To add a new index definition, click Add Index from the toolbar
  4. In the Index Name column enter the name of the index
  5. Double-click on the Field(s) Name grid
  6. To add fields for the index, enter the fields name to the grid.
  7. Click Save or Save As from the toolbar when you are ready to save the table

Delete an index

  1. Open the table in Design View
  2. Select the Indexes tab
  3. Select the index you want to delete and click Delete Index from the toolbar
  4. Click Save or Save As from the toolbar when you are ready to save the table

Prevent duplicate values from being entered in a combination of fields

  1. Open the table in Design View
  2. Select the Indexes tab
  3. To add a new index definition, click Add Index from the toolbar
  4. In the Index Name column enter the name of the index
  5. Double-click on the Field(s) Name grid, add the fields for the index
  6. In the Index Type, select Unique
  7. Click Save or Save As from the toolbar when you are ready to save the table

Prevent duplicate values from being entered into a field

  1. Open the table in Design View
  2. Select the Indexes tab
  3. To add a new index definition, click Add Index from the toolbar
  4. In the Index Name column enter the name of the index
  5. Double-click on the Field(s) Name grid, add a field for the index
  6. In the Index Type, select Unique
  7. Click Save or Save As from the toolbar when you are ready to save the table

Index Type

Type Details
B-tree These indexes can handle equality and range queries on data that can be sorted into some ordering.
R-tree These indexes are suited for queries on spatial data.
Hash These indexes can only handle simple equality comparisons.
GiST These indexes are not a single kind of index, but rather an infrastructure within which many different indexing strategies can be implemented.