I re-ran both queries without the “ORDER by row DESC” argument to demonstrate the fact that sorting is killing the overall query performance.
Here is the query for the 1st table:
SELECT row FROM tbl_data_columnstore_shards_no WHERE (addrFrom = ‘0xFBb1b73C4f0BDa4f67dcA266ce6Ef42f520fBB98’ OR addrTo = ‘0xFBb1b73C4f0BDa4f67dcA266ce6Ef42f520fBB98’) LIMIT 25 OFFSET 0;
Here is the query for the 2nd table:
SELECT row FROM tbl_data_columnstore_shards_yes WHERE (addrFrom = ‘0xFBb1b73C4f0BDa4f67dcA266ce6Ef42f520fBB98’ OR addrTo = ‘0xFBb1b73C4f0BDa4f67dcA266ce6Ef42f520fBB98’) LIMIT 25 OFFSET 0;
Below are links to the pastebins of both JSON files.
tbl_data_columnstore_shards_no (435 ms to run):
https://pastebin.com/n0JAUqJy
tbl_data_columnstore_shards_yes (400 ms seconds to run):
https://pastebin.com/hRbdKVgJ
Below are screenshots to the profiles of both queries.
tbl_data_columnstore_shards_no (435 ms to run):
tbl_data_columnstore_shards_yes (400 ms to run):

