4.3.1 Re-executing queries

If you want to reproduce a problem event that has occurred, or re-check summary analysis results, you re-execute queries by reloading the data for a specific time period.

To re-execute queries, you use the sdptplput command. For the target data to be re-processed, use information about the input tuples collected in the tuple log file. When you execute the command, tuples are reloaded to the input stream queues from the tuple information collected in the tuple log file. After reloading of tuples is completed, the putEnd method is executed on all input stream queues, and the query group is initialized.

You can check the result of query re-execution by using the sdptplls command to display the tuple information collected from the output stream queue to the tuple log.

The following figure shows the flow of data when queries are re-executed to check execution results.

Figure 4-2 Flow of data during query re-execution

[Figure]

  1. Execute the sdptplput command (with tuple log A specified) to reload tuples.
  2. Re-execute the query on the loaded tuples.
  3. Execute the sdptplls command (with tuple log B specified) to check the tuple information.

The following subsections discuss the permitted range of query re-execution, query re-execution procedure, and notes about re-executing queries.

Organization of this subsection
(1) Permitted range of query re-execution
(2) How to re-execute queries
(3) Notes about re-executing queries

(1) Permitted range of query re-execution

The permitted range of query re-execution differs between the server mode and the data source mode. The permitted range is as follows:

For details about the timestamp adjustment function, see 10.8 Timestamp adjustment for tuples.

(2) How to re-execute queries

You use a tuple log file that has been acquired to re-execute a query. A query can be re-executed in an environment that is different from the environment used to acquire the tuple logs, except that the default character encoding must be the same in both environments.

This example assumes that the environment in which queries are re-executed is different from the environment where tuple logs were acquired.

To re-execute queries:

  1. Copy the required files to the environment where queries are to be re-executed.
    Copy the query definition files for the query group to be re-executed, query group property file, and tuple log file from the environment where tuples were acquired to the environment where the queries are to be re-executed.
  2. Specify the settings required for acquiring tuple logs.
    Specify BUFFER in the tpl.outputTrigger parameter in the query group property file to acquire tuple logs from the output stream queue. If you use a tuple log file acquired in the server mode, specify true in the stream.tupleLogMode parameter.
  3. Register the query group to be re-executed.
    Use the sdpcql command to register the query group to be re-executed.
  4. Start the query group to be re-executed.
    Use the sdpcqlstart command to start the query group to be re-executed.
  5. Re-execute the queries.
    Use the sdptplput command to reload tuples from the tuple log file and then re-execute the queries.
  6. Check the results.
    Use the sdptplls command to display the contents of the tuple log file in the output stream queue and check the results.

For details about the sdpcql, sdpcqlstart, sdptplput, and sdptplls commands, see sdpcql (registers a query group), sdpcqlstart (starts a query group), sdptplput (reloads tuples), and sdptplls (displays tuple information) in 7. Commands.

(3) Notes about re-executing queries