4D v14.3DESCRIBE QUERY EXECUTION |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v14.3
DESCRIBE QUERY EXECUTION
DESCRIBE QUERY EXECUTION
The DESCRIBE QUERY EXECUTION command enables or disables the query analysis mode for the current process. The command only works in the context of 4D language query commands such as QUERY. Calling the command with the status parameter set to True enables the query analysis mode. In this mode, the 4D engine records internally two specific pieces of information for each subsequent query carried out on the data:
The information recorded includes the type of query (indexed, sequential), the number of records found and the time needed for every query criteria to be executed. Y ou can then read this information using the Get last query plan and Get last query path commands. Usually, the description of the query plan and its path are the same, but they may nevertheless differ because 4D might implement dynamic optimizations during the query execution in order to improve performance. For example, an indexed query may be converted dynamically into a sequential query if the 4D engine estimates that this might be faster — this is sometimes the case, more particularly, when the number of records being queries is low. Pass False in the status parameter when you no longer need to analyze queries. The query analysis mode can slow down the application. The following example illustrates the type of information obtained using these commands: C_TEXT($vResultPlan;$vResultPath) After executing this code, $vResultPlan and $vResultPath contain descriptions of the queries performed, for example: $vResultPlan : If the Description in XML Format constant is passed to the Get last query path command, $vResultPath contains the description of the query expressed in XML: $vResultPath : <QueryExecution> <steps description="And" time="0" recordsfounds="1227"> <steps description="[Merge] : ACTORS with CITIES" time="13" recordsfounds="1227"> <steps description="[Join] : ACTORS.Birth_City_ID =CITIES.City_ID" time="13" recordsfounds="1227"/> </steps> </steps> </QueryExecution> |
PROPERTIES
Product: 4D
HISTORY
Created: 4D v11 SQL Release 1 SEE ALSO
Get last query path ARTICLE USAGE
4D Language Reference ( 4D v12.4) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||