Roger Binns, I ran some tests today and found that sqlite3_blob_reopen is 
significantly faster than sqlite3_blob_open. Attached is the Very Sleepy Full 
Profiler report.  The modified C++ code is shown below. Thank you.
 
unsigned long *cIntersectingDedupe::GetSubGraphBlob(sSUBGRAPHINFO 
*SubGraph_,int *Size_) {
 int Size;
 unsigned long *RetVal;

 // Grab a BLOB and put it into a unsigned long buffer. As the BLOB contains 
record numbers,
 //   we will never see a value of zero. Thus, we use 0 to mark the end of the 
array.
 //
 // Note that we can have BLOBs of size 0, though. If we used DistillSubGraph to
 //   dedupe the subgraph, some records will be consolidated into others. The
 //   donor record's BLOB gets zapped because all of it's BLOB was rolled into 
the
 //   donee (All your BLOB are belong to us!)
 if (SubGraph_->hBlob == 0){
  
sqlite3_blob_open(SubGraph_->Database,"main","AggregatedData","Rows",SubGraph_->IteratorPos+1,0,&(SubGraph_->hBlob));
 }
 else{
                sqlite3_blob_reopen(SubGraph_->hBlob,SubGraph_->IteratorPos+1);
 }
 Size=sqlite3_blob_bytes(SubGraph_->hBlob)/sizeof(unsigned long);
 RetVal=new unsigned long[(Size+1)*sizeof(unsigned long)];
 sqlite3_blob_read(SubGraph_->hBlob,RetVal,Size*sizeof(unsigned long),0);
 RetVal[Size]=0;
 if (Size_!=0)
  *Size_=Size;
 return RetVal;
}
 
 
 



Frank has a file to share with you on SkyDrive. To view it, click the link 
below.






sqlite3_blob_reopen.ppt


 
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to