Skip to content

SAP IQ: How to Estimate the Number of Rows Loaded

April 2, 2014

It is a common practice to transform the data in different environments and then move the data to SAP IQ (for example, we can prepare dataset/fact tables in SAS and then load then to the EDW in SAP IQ).

To monitor the loading process it is important to know the number of rows that has been loaded at a given time and the average loading time.

Here, I present a simple method to estimate those 2 metrics.

Identify the transaction ID of the loading process (column TxnID of sp_connection store procedure).

Execute the following query:

select datediff(ss, TxnCreateTime, now()) as secondsOfExec,
round(SpCount/2, 0) as RowsLoaded,
round(SpNumber / datediff(ss, TxnCreateTime, now()),0) as avgRowsPerSecond
from sp_iqtransaction()
where TxnID = <TxnID>

You will get a result similar to this:

secondsOfExec: 332
RowsLoaded: 20083
avgRowsPerSecond: 120

1 record(s) selected [Fetch MetaData: 0ms] [Fetch Data: 0ms]

[Executed: 02/04/2014 11:57:24 AM] [Execution: 31ms]

Explanation:

IQ sets an implicit savepoint before and after every DML command[1].

[1] http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc01771.1600/doc/html/san1288042911205.html

Advertisements

From → SAP IQ

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: