Home page  
Help >
ddlRequestDataStrategy() - compute optimum strategy for data resolution
Version 7.11
ddlRequestDataStrategy() - compute optimum strategy for data resolution ddlRequestDataStrategy() - compute optimum strategy for data resolution

Prototype:
   void ddlRequestDataStrategy(
      CONTROL *ctl,
      char *OptnStr,
      char *ArgList,
      TBAPI_REQUEST_DATA *DataRequestVec[],
      int DataRequestCount);
 
   typedef struct TBAPI_REQUEST_DATA{
      int iReturnDataStrategyCode;      /* [OUT] */
      char szFullColumnName[4];         /* [IN] */
   }TBAPI_REQUEST_DATA;
    
   /* enum for iReturnDataStrategyCode ... */
   enum{
      eDataDirectRead      = 1,
      eDataSourceRead      = 2,
      eDataInvertIndex     = 3
   };
Permitted values in OptnStr: NA

Form of ArgList:
      <CxName> <Table-name> <record-count>
Where: <CxName> is the name of the source collection.
<Table-name> is the name of an Table that contains the requested columns
<record-count> is the estimated number of records to be read

Description of Parameter *DataRequestVec[]
TBAPI_REQUEST_DATA *DataRequestVec[] is an array containing DataRequestCount pointers; each structure contains the name of one column of interest.
Note that the structure definition for TBAPI_REQUEST_DATA assumes that the last member, char szFullColumnName[4], will be extended to the necessary size by allocating additional memory to the structure.

Description:
ddlRequestDataStrategy() computes an optimum strategy for resolving a data requirement that includes virtual and non-virtual data elements.

The requested data elements may include columns from multiple tables. However, internally the strategy calculation is applied separately for each table.

For each element (column), there are three possible paths:
      . Read directly from non-virtual data
      . Read from inverted virtual index;
      . Read from original data source;

The algorithm [per table]:
      . If all requested elements are non-virtual, assign all as non-virtual read;
      . If one or more requested element is virtual non-index, assign all virtual elements as read data source;
             in this case, assign non-virtual elements as non-virtual read;
      . For the general case of one or more virtual indexes, we make the simplifying assumption to do virtual
             elements as either all data source read; or all virtual index invert.
             We do this by assigning a cost to each alternative; at this point we consider only time cost; however, there
             are other costs that we may need to consider; for example, memory, network bandwidth and source CPU.
             We assign a cost of 1.0 for a direct data read; that cost is the same for one column or multiple columns;
             We assign a cost of 100.0 for a data source read; this cost is also constant for one column or multiple columns;
             We assign a cost of 1.0 X <table-size> for a virtual index inversion;


Copyright © 2019 , WhamTech, Inc.  All rights reserved. This document is provided for information purposes only and the contents hereof are subject to change without notice. Names may be trademarks of their respective owners.