cancel
Showing results for 
Search instead for 
Did you mean: 

Are the IndAdd and IndLookup properties reversed?

Breck_Carter
Participant
4,196

Here's what they look like for a 16.0.0.2052 database busy doing SELECT and UPDATE operations, no INSERTs...

SELECT DB_PROPERTY ( 'IndAdd' ), DB_PROPERTY ( 'IndLookup' );

DB_PROPERTY('IndAdd'),DB_PROPERTY('IndLookup')
'401941','150'

SELECT Number, PropName, Value 
  FROM sa_conn_properties() 
 WHERE PropName IN ( 'IndAdd', 'IndLookup' )
 ORDER BY Number, PropName;

Number,PropName,Value
3,'IndAdd',80
3,'IndLookup',0
4,'IndAdd',9990
4,'IndLookup',0
5,'IndAdd',9990
5,'IndLookup',0
6,'IndAdd',9990
6,'IndLookup',0
7,'IndAdd',9990
7,'IndLookup',0
8,'IndAdd',9990
8,'IndLookup',0
9,'IndAdd',9990
9,'IndLookup',0
10,'IndAdd',9990
10,'IndLookup',0
...
CREATE TABLE DBA.inventory ( -- 1,000,000 rows, 28M total = 27M table + 40k ext + 960k index, 30 bytes per row
   item_id         /* PK        */ INTEGER NOT NULL DEFAULT autoincrement,
   item_count                      INTEGER NOT NULL,
   item_name                       VARCHAR ( 1024 ) NOT NULL,
   updated_at                      TIMESTAMP NOT NULL DEFAULT timestamp,
   last_modified   /*         X */ TIMESTAMP NOT NULL DEFAULT timestamp,
   CONSTRAINT ASA78 PRIMARY KEY ( -- 356k
      item_id )
 );
-- Parents of DBA.inventory
-- none --
-- Children
-- none --
CREATE INDEX inventory_ml ON DBA.inventory ( -- 604k
   last_modified );
  DO WHILE lb_continuing

   ll_pkey = Rand ( 100 ) * 10000 + il_thread_index;

   ls_sql = "UPDATE inventory SET item_count = item_count + 1 WHERE item_id = " + String ( ll_pkey )

   EXECUTE IMMEDIATE :ls_sql USING itr_sqlca;

   IF SQLCA.SQLCODE <> 0 THEN

    UPDATE thread_status 
     SET thread_status.status = 'error',
       SQLDBCode = :SQLCA.SQLDBCode,
       SQLErrText = :SQLCA.SQLErrText
     WHERE thread_status.thread_index = :il_thread_index
     USING itr_sqlca;

    COMMIT USING itr_sqlca;

    lb_continuing = FALSE

   END IF   

Accepted Solutions (0)

Answers (0)