Reputation: 1149
I want to compare data between two databases, where there are 700K records to be compared, and that number is increasing all the time. My architecture is:
Where based on the MAIN query i run:
JDBC1 & JDBC2 and, then i compare the data between JDBC1 & JDBC2.
If i put static limit in the main query,
select * from transaction_info
order by id asc
limit 1000
everything works fine, and i know how to compare the data. But, how can i make all this dynamic, so i can break-down the main query like:
1. Query first 1000 rows, then compare/assert.
2. Query next 1000 rows then compare/assert.
And all this to continue till the 700K records?
Any help is appreciated!
Upvotes: 0
Views: 216
Reputation: 694
As part of your main query SQL, you can include a combination of LIMIT and OFFSET to get incremental fetch of rows and variabilize the OFFSET part like below in order to bring in the dynamism
select * from my_table limit 1000 offset ${offset_value}
For the offset variable, define a Counter config element whose starting value is 1000, increments by 1000 until a max value of 700K. In case you want each user to do this process, then check on "Track counter independently for each user"
This way, everytime you will fetch 1000 rows then the subsequent 1000 in sequence
My suggestion for Test Plan
You can remove the loop controller and place the sub-queries along with assertion as siblings to the Main query and define the Thread Group's loop count to 700. This way the main query along with the sub-queries and assertion are triggered 700 times with each time fetching, processing and asserting 1000 rows at a time.
Sample Test Plan
Thread Group Loop Count Configuration
Hope this helps!
Upvotes: 1