While you update a table that is involved in a join index, that join index is unavailable to other writers. Sybase IQ lets you control when it updates join indexes, because such updates may take a lot of time depending on the order of updates to various tables referenced by the indexes.
The SYNCHRONIZE JOIN INDEX command updates one or all of the join indexes in the current database belonging to the connected user. If you do not specify one or more indexes as argument(s), it synchronizes all join indexes in the current database.
To update a join index, Sybase IQ must update all the other join indexes that reference a table in the join, as well as all the join indexes that reference tables in those join indexes.
You may choose to issue this command before you finish a group of INSERT or DELETE statements, so that the data will become available to users as soon as the command finishes. You may alternatively choose to run a batch job to issue the command at a time when you know the load on the machine is light to avoid system slowdowns. After each SYNCHRONIZE JOIN INDEX statement, you need to issue a COMMIT statement.
For best performance, avoid issuing the SYNCHRONIZE JOIN INDEX command after every insert or delete.
In this chapter, we've made several changes to the employee table. To synchronize the employee/sales_order join index (EMP_SO_JDX), issue the following commands:
SYNCHRONIZE JOIN INDEX EMP_SO_JDX COMMIT