Creating a Join Index for SalesOrders and SalesOrderItems

This example shows you how to create join indexes. The first join index, so_soi_jdx, joins the sales_order and sales_order_items tables.

  1. Right-click Join Indexes, point to New, and choose Join Index.
  2. In the Name and Table dialog, enter so_soi_jdx for the name.
  3. In the Join Type dropdown list, select Natural, because you are joining equivalent columns with the same name (id) from two tables.
  4. Choose SalesOrders for the left table.
  5. Choose SalesOrderItems for the right table.
  6. Click Next. Sybase IQ locates the join columns.
  7. In the Comment space, type the following to describe the join index, Join index for SalesOrders and SalesOrderItems.
  8. Click Finish. The so_soi_jdx join index appears in the Join Indexes folder.
Note: When joining with the NATURAL keyword, take care that only the columns to be joined have the same name. (For example id = id.) Watch out for common column names like date and description.