PDQ question
Posted in 2000
We have a fragmented table (round robin) in two dbspaces with two detached
indexes in a third dbspace. All dbspaces are on different disks.
PDQ priority is set to 100, the machine has two processors
Selecting all rows (sequential scan) results in 3 Informix threads and
evenly distributed load on the two disks where the table resides. The table
data is being accessed in parallel.
Selecting all rows and forcing an index path, results in 2 Informix threads
and uneven distribution of load on the three disks: The disk where the index
resides is being accessed all the time and the disks where the table resides
are never accessed in parallel. Activity alternates between the two. One
disk is accessed for a period of time (5-10 seconds) and then activity moves
to the other disk and so on.
In essence the table is read serially.
onstat -D was used to monitor the activity on each dbspace.
'Set explain' on both sqls results in "(Parallel, fragments: ALL)" as the
access method for the table.
At the same time if the fragmented table is used as the inner table in a
nested loop join and accessed through the same index, the table data is
again read serially.
The question is whether this is normal behavior or is it a setting in our
set up that prevents parallel access through an index.
The following script can be used to replicate the issue:
Create table t1 (serno serial, Key1 integer, data1 char(20), data2 Char(20))
fragment by round robin in dbspace2, dbspace3;
Create Procedure fillup_t1()
Define i, key integer; for i = 1 to 5000000
let key = mod(i,2);
insert into t1 (Key1, data1, data2) values (key, 'data1' ,'data2');
End for;
End Procedure;
execute procedure fillup_t1();
drop procedure fillup_t1;
create unique index t1unq on t1(serno) in dbspace1;
create index t1x01 on t1(Key1) in dbspace1;
update statistics high for table t1(serno);
update statistics high for table t1(key1);
-- SQL results in parallel access of table
set pdqpriority 100;select {+ explain}
key1, data1, data2
from t1
into temp t2 with no log;
sqexplain:
DIRECTIVES FOLLOWED:EXPLAIN
DIRECTIVES NOT FOLLOWED:
Estimated Cost: 86430
Estimated # of Rows Returned: 500000
Maximum Threads: 2
1) cap.t1: SEQUENTIAL SCAN (Parallel, fragments: ALL)
-- SQL results in serial access of table
set pdqpriority 100;select {+ index(t1 t1x01), explain}
key1, data1, data2
from t1
into temp t2 with no log;
sqexplain:
DIRECTIVES FOLLOWED:
INDEX ( t1 t1x01 )EXPLAIN
DIRECTIVES NOT FOLLOWED:
Estimated Cost: 175332
Estimated # of Rows Returned: 1000000
Maximum Threads: 1
1) cap.t1: INDEX PATH
(1) Index Keys: key1 (Parallel, fragments: ALL)
Any help would be welcome.