Narrow width layout Medium width layout Full-screen width layout    Small text Medium text Large text    Color Palette Selector      Search
Register  |  
Forum policy    

These Discussion Forums are dedicated to discussions on Sophis products. Some are private, you shall be connected to see their content.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to Sophis products.
2. No Flaming or Trolling.
3. No Profanity, Racism, or Prejudice.
4. Publishing information for insider trades or other illegal trading is forbidden and will be reported,
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

Private messaging between users is enable. If you already put a message on forums, a registered user can send you a private message by clicking on the username link, and thus on the "Message User" link on the "Private Messaging" row. The messages can be read by clicking on the Inbox button of the toolbar.

 
Forums    
 
  Forum  Development  Database  Performance on CSRUniversalReferenceList::GetUniversalReference
Previous Previous
 
Next Next
New Post 9/23/2008 10:28 PM
  Philippe Bonneau
254 posts
www.ebsys.fr
1st Level Poster


Performance on CSRUniversalReferenceList::GetUniversalReference 

Hi,

It's really poor!!! Each call to CSRUniversalReferenceList::GetUniversalReference makes a query on database. Same thing concerning CSRInstrument::GetClientReference. I had to make a dump into a file of the instruments in position, of course, I'm using a memory cache using the ITQMemoryCache framework.

The query to get the informations on the universal reference definitions - without taking the allotments and currencies into account - and to store it in a cache is the following one:

select r.reference,d.ref_ident from references r, extrnl_references_definition d where r.model='Other reference' and r.data=d.ref_name

Thus, the returned ref_ident is used with the sicovam of the instrument on another cache loaded by using this query:

select sophis_ident,ref_ident,value from extrnl_references_instruments where sophis_ident in(select sicovam from histomvts where opcvm in(select ident from folio where level>=0 connect by mgr=prior ident start with ident=<the_root_folio_id>))

And the C++ code that is currently used looks like:

 static SSReference _dumpReference[] = {
     {"ISIN","ISIN",__OFFSET_OF(SSInstrument,m_isin) },
     {"BLOOMBERG","BLOOMBERG",__OFFSET_OF(SSInstrument,m_bloomberg) },
     {"REUTERS","REUTERS",__OFFSET_OF(SSInstrument,m_reuters) },
     {"TICKER","TICKER",__OFFSET_OF(SSInstrument,m_ticker) },
     ....
     {"SECURITYDES","SECURITYDES",__OFFSET_OF(SSInstrument,m_securityDES) } };

 int _referenceCount = sizeof(_dumpReference) / sizeof(SSReference);
 for(int i=0;i<_referenceCount;i++)
 {
  // using the cache on the extern references...
  if(m_accReferenceDefinitions)
   m_accReferenceDefinitions->SetValue(_dumpReference[i].m_universal);

  m_valueAccessor.SetRowId(-1); // reset the result of the precedent search
  m_valueAccessor.SetType(itq::memorycache::IITQAccessor::evtNull); // let the cache input the type
  if(m_accReferenceDefinitions && m_cacheReferences && m_cacheReferenceDefinitions->GetItem(m_indexReferenceDefinitions,m_keyReferenceDefinitions,&m_valueAccessor))
  {
   long _referenceId = (*(long*)m_valueAccessor.GetValue());
   // true, we can get using the other memory cache
   m_accReferences1->SetValue(&_sicovam);
   m_accReferences2->SetValue(&_referenceId);

   m_valueAccessor.SetRowId(-1); // reset the result of the precedent search
   m_valueAccessor.SetType(itq::memorycache::IITQAccessor::evtNull); // let the cache input the type
   if(m_cacheReferences->GetItem(m_indexReferences,m_keyReferences,&m_valueAccessor))
   {
    char _value[21]; // 20 car. max in database of the value of extern ref (extrnl_references_instruments)
    int _size = sizeof(_value);
    if(m_valueAccessor.GetStringValue(_value,&_size)) // a right code should increase the value...
     (*(_STL::string*)((char*)(&_record)+_dumpReference[i].m_offset)) = _value;
    else // or just prevent that we have to change the code because Sophis made some chgt  in db
    {
     ITQ_LOG(Log::error,"Unable to retrieve the value, buffer too small");
    }
   }

Rgds,
Philippe

 
Previous Previous
 
Next Next
  Forum  Development  Database  Performance on CSRUniversalReferenceList::GetUniversalReference
 Syndicate  

Copyright 2007-2008 by Ebsys  | Terms Of Use | Privacy Statement  | Skin by Speerio