Salesforce

Best way to add new index to table with large count of records?

« Go Back

Information

 
TitleBest way to add new index to table with large count of records?
URL Name000041377
Article Number000188119
EnvironmentProduct: OpenEdge
Version: All supported versions
OS: All supported platforms
Question/Problem Description
Best way to add new index to table with large count of records?
How to add a new index to table with large number of records
What is the fastest way to build an index when adding a new indexed field ?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
The best way to add a new index to an existing database with a large number of records is to define the new index as inactive in the Data Dictionary or .df file. This will postpone the generation of the index keys.

It is strongly recommended that largefiles are enabled for the database to avoid hitting file maximum sizes, which requires the Enterprise RDBMS license. Large files support was introduced in Progress 9.1C on most platforms. It is enabled by default since OpenEdge 12. To enable large files use the following command:
$   proutil <dbname> -C enablelargefiles

Method 1:  Run IDXBUILD offline

The quickest way to activate an index is to take the database offline and build the index with the IDXBUILD utility
  • A verified backup of the database is required in the event the idxbuild fails, which will render the database inaccessible until the IDXBUILD completes
  • After-imaging must be disabled before running an IDXBUILD
Example:
  1. proutil sports2000 -C idxbuild -B 32000 -TB 64 -TM 32 -TMB 128 -TF 60 -SG 64 -thread 1 -threadnum 4 -mergethreads 4 -datascanthreads 4 -pfactor 90 -rusage -SS /path/pcs-base.srt
  2. Choose the some option.
  3. Provide the table name
  4. Provide the index name
  5. Enter ! to end the table and index selection.
  6. Enter y to indicate sufficient sort space.
Refer to Articles:
Method 2. Run IDXACTIVATE online 

If the database cannot be taken offline, then add the index as INACTIVE and use IDXACTIVATE to build the index ideally with an active unique index and Database Client Notification active (-usernotifytime). For further information refer to Article: What is IDXACTIVATE?  

Example: IDXACTIVATE is scoped to building the inactive index from the key-fields in 500 records at a time, reporting on clients blocking activation every 10 seconds 
$   proutil sports2000 -C idxactivate pub.customer.name useindex cust-num recs 500 refresh 10
Workaround
Notes
Keyword Phrase
Last Modified Date11/20/2020 6:50 AM

Powered by