NextResultRow is extremely slow reading blobs. Is this a known problem, or am I doing something wrong?
Details:
On lxplus (lx32slc4) using either of the following ROOTSYS
ROOTSYS=/afs/cern.ch/sw/lcg/external/root/5.15.08/slc3_ia32_gcc323/root
ROOTSYS=/afs/cern.ch/sw/lcg/external/root/5.14.00c/slc3_ia32_gcc323/root
and oracle
ORACLE_HOME=$ORACLE_CERN/instantclient/10.2.0.3/slc3_ia32_gcc323
I find that trying to read back takes almost 3 minutes at the NextResultRow step.
std::string q1(“SELECT Profile_1,Profile_2,Profile_3,Profile_4 FROM DCOPS_PROFILES WHERE LINE_TIMESTAMP=”);
It is not normal, that GetNextResultRow takes so much time (several minutes). Actually, beside several buffers cleanups, this method contains just direct OCCI call (Oracle C++ Call Interface). And during this call no data is retrieved from database. Only when you use GetBinary(), buffers are created and filled from database.
Therefore, can you elaborate following:
How long it takes for next calls of GetNextResultRow() method.
Can you test your statement performance without WHERE condition.
It can be the main reason for long delay - if you have a lot of data in database and tries to select with WHERE statement over the field, which is not indexed.
non-NULL property only helps you to avoid mistakes when you insert data into database. But it has nothing to do with indexing. Indexes should be created with extra SQL commands and may take as many disk space on server as data base itself.
Fortunately I don’t seem to have the same problems with the fit information table, which is (for now) much smaller. It will grow at about 30 MB/day in full production. But if size is an issue, perhaps I should look at redesigning in order to take advantage of indexing.
The problematic table contains BLOBs of laser beam profile information, which we’re using to debug the peak fitting. In the final system we’ll only turn it on now and then for spot checking.