ERROR: [Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point:

Hi
We have a cluster of 3 master and 12 Tservers and a daily partitioned table. While querying for last 1 month of data from the table and putting it in a csv, we are receiving error as snapshot too old after 4, 4.30hrs. Our query is as below:

select payer, payee, count(1) from dw_tbl WHERE txndatetime >= ‘2024-05-30 00:00:00’ and txndatetime < ‘2024-07-01’ and payersec = ‘0000’ and sec = ‘0000’ and Mode not in (‘11’,‘12’,‘13’) and txnP not in (‘20’,‘41’,‘42’,‘43’,‘44’,‘45’,‘92’) and txntype = ‘FINANCIAL’ group by 1,2.

Error:

ERROR: [Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719910447442589 logical: 1 }, delta (usec): 3235802173: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719912039963674 }, delta (usec): 4828323258: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719912839072654 logical: 3 }, delta (usec): 5627432238: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719913148207813 logical: 13 }, delta (usec): 5936567397: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719914163384814 logical: 4 }, delta (usec): 6951744398: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719914209748896 logical: 1 }, delta (usec): 6998108480: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719914322532350 }, delta (usec): 7110891934: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719916216469024 logical: 3 }, delta (usec): 9004828608: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719916244663922 }, delta (usec): 9033023506: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719916448934658 }, delta (usec): 9237294242: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719916976755842 }, delta (usec): 9765115426: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719917716641236 }, delta (usec): 10505000820: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719918337607207 }, delta (usec): 11125966791: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719918664415271 }, delta (usec): 11452774855: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719919345162167 }, delta (usec): 12133521751: kSnapshotTooOld (transaction error 4), Snapshot too old (yb/tablet/tablet_retention_policy.cc:162): Snapshot too old. Read point: { physical: 1719907211640416 }, earliest read time allowed: { physical: 1719919966709717 }, delta (usec): 12755069301: kSnapshotTooOld (transaction error 4)]
Time: 14692410.637 ms (04:04:52.411)

Please help.

Hi,
To avoid uncontrolled bloat when a transaction runs away (which is what happens in Postgres), we set the retention for the multi-value concurrency control retention with timestamp_history_retention_interval_sec, which defaults to 15 minutes.
After that, compaction may remove intermediate versions and long query errors with Snapshot Too Old. When you know that you have long queries, you can increase the retention, but first, check if it is expected that this query runs for hours. Can you show the structure ( \d dw_tbl ) and execution plan:

explain verbose 
select payer, payee, count(1) from dw_tbl WHERE txndatetime >= ‘2024-05-30 00:00:00’ and txndatetime < ‘2024-07-01’ and payersec = ‘0000’ and sec = ‘0000’ and Mode not in (‘11’,‘12’,‘13’) and txnP not in (‘20’,‘41’,‘42’,‘43’,‘44’,‘45’,‘92’) and txntype = ‘FINANCIAL’ group by 1,2

And also which version of YugabyteDB

We are using version 2.20.1.3.
I have also tried increasing the value timestamp_history_retention_interval_sec to 6hrs , while quering in a single node like below.

nohup /pg_data_master/yugabyte/yugabyte-2.20.1.3/bin/ysqlsh -h 10.91.88.74 -p 5536 -d efdb efusr -c ‘SELECT statement_timestamp();’ -c ‘\timing’ -c ‘begin transaction isolation level serializable read only deferrable;’ -c ‘! /pg_data_master/yugabyte/yugabyte-2.20.1.3/bin/yb-ts-cli --server_address=10.91.88.74 set_flag --force timestamp_history_retention_interval_sec 21600’ -c “\copy (select payer, payee, count(1) from dw_tbl WHERE txndatetime >= ‘2024-05-30 00:00:00’ and txndatetime < ‘2024-07-01’ and payersec = ‘0000’ and sec = ‘0000’ and Mode not in (‘11’,‘12’,‘13’) and txnP not in (‘20’,‘41’,‘42’,‘43’,‘44’,‘45’,‘92’) and txntype = ‘FINANCIAL’ group by 1,2;) to /tmp/cs_may-jn-agg-3005-0701.csv WITH CSV HEADER” -c ‘SELECT statement_timestamp();’ > /tmp/cs_may-jn-3005-0701.log &

still received snapshot too old error. Do i need to add this flag timestamp_history_retention_interval_sec in tserver.conf for entire cluster then query?

Please find below,Table structure and explain plan

dw_tbl
*************
( payee   		character varying(200), 
 payerg 		character varying(50),  
 txndatetime 	timestamp with time zone,
 rr    			character varying(20),  
 payer 			character varying(200), 
 payersec 		character varying(12),  
 txnsub 		character varying(20),  
 Mode 			character varying(2),   
 offlin 		boolean,                
 txnP 			character varying(255), 
 txntype 		character varying(20),  
 payeev 		character varying(255), 
 sec    		character varying(4),   
 txnid 			character varying(20), 
 .
 .
 .
 94 columns 
 )
Partition key: RANGE (txndatetime)
Indexes:
    "dw_tbl_pkey" PRIMARY KEY, lsm (txnid HASH, rr ASC, txndatetime ASC)
Number of partitions: 107 (Use \d+ to list them.)
                                 QUERY PLAN

-------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------
 HashAggregate  (cost=4400.00..4432.00 rows=3200 width=1040)
   Output: dw_tbl_20240530.payer, dw_tbl_20240530.payee, count(1)
   Group Key: dw_tbl_20240530.payer, dw_tbl_20240530.payee
   ->  Append  (cost=0.00..4160.00 rows=32000 width=1032)
         ->  Seq Scan on dw_tbl_20240530  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240530.payer, dw_tbl_20240530.payee
               Remote Filter: ((dw_tbl_20240530.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240530.txndatetime < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240530.payersec)::text = '0000'::text) AND ((dw_tbl_20240530.sec)::text = '
0000'::text) AND ((dw_tbl_20240530.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240530.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240530.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240531  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240531.payer, dw_tbl_20240531.payee
               Remote Filter: ((dw_tbl_20240531.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240531.txndatetime < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240531.payersec)::text = '0000'::text) AND ((dw_tbl_20240531.sec)::text = '
0000'::text) AND ((dw_tbl_20240531.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240531.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240531.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240601  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240601.payer, dw_tbl_20240601.payee
               Remote Filter: ((dw_tbl_20240601.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240601.txndatetime < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240601.payersec)::text = '0000'::text) AND ((dw_tbl_20240601.sec)::text = '
0000'::text) AND ((dw_tbl_20240601.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240601.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240601.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240602  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240602.payer, dw_tbl_20240602.payee
               Remote Filter: ((dw_tbl_20240602.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240602.txndatetime < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240602.payersec)::text = '0000'::text) AND ((dw_tbl_20240602.sec)::text = '
0000'::text) AND ((dw_tbl_20240602.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240602.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240602.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240603  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240603.payer, dw_tbl_20240603.payee
               Remote Filter: ((dw_tbl_20240603.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240603.txndatetime < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240603.payersec)::text = '0000'::text) AND ((dw_tbl_20240603.sec)::text = '
0000'::text) AND ((dw_tbl_20240603.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240603.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240603.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240604  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240604.payer, dw_tbl_20240604.payee
               Remote Filter: ((dw_tbl_20240604.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240604.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240604.payersec)::text = '0000'::text) AND ((dw_tbl_20240604.sec)::text = '
0000'::text) AND ((dw_tbl_20240604.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240604.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240604.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240605  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240605.payer, dw_tbl_20240605.payee
               Remote Filter: ((dw_tbl_20240605.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240605.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240605.payersec)::text = '0000'::text) AND ((dw_tbl_20240605.sec)::text = '
0000'::text) AND ((dw_tbl_20240605.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240605.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240605.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240606  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240606.payer, dw_tbl_20240606.payee
               Remote Filter: ((dw_tbl_20240606.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240606.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240606.payersec)::text = '0000'::text) AND ((dw_tbl_20240606.sec)::text = '
0000'::text) AND ((dw_tbl_20240606.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240606.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240606.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240607  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240607.payer, dw_tbl_20240607.payee
               Remote Filter: ((dw_tbl_20240607.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240607.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240607.payersec)::text = '0000'::text) AND ((dw_tbl_20240607.sec)::text = '
0000'::text) AND ((dw_tbl_20240607.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240607.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240607.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240608  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240608.payer, dw_tbl_20240608.payee
               Remote Filter: ((dw_tbl_20240608.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240608.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240608.payersec)::text = '0000'::text) AND ((dw_tbl_20240608.sec)::text = '
0000'::text) AND ((dw_tbl_20240608.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240608.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240608.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240609  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240609.payer, dw_tbl_20240609.payee
               Remote Filter: ((dw_tbl_20240609.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240609.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240609.payersec)::text = '0000'::text) AND ((dw_tbl_20240609.sec)::text = '
0000'::text) AND ((dw_tbl_20240609.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240609.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240609.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240610  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240610.payer, dw_tbl_20240610.payee
               Remote Filter: ((dw_tbl_20240610.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240610.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240610.payersec)::text = '0000'::text) AND ((dw_tbl_20240610.sec)::text = '
0000'::text) AND ((dw_tbl_20240610.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240610.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240610.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240611  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240611.payer, dw_tbl_20240611.payee
               Remote Filter: ((dw_tbl_20240611.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240611.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240611.payersec)::text = '0000'::text) AND ((dw_tbl_20240611.sec)::text = '
0000'::text) AND ((dw_tbl_20240611.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240611.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240611.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240612  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240612.payer, dw_tbl_20240612.payee
               Remote Filter: ((dw_tbl_20240612.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240612.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240612.payersec)::text = '0000'::text) AND ((dw_tbl_20240612.sec)::text = '
0000'::text) AND ((dw_tbl_20240612.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240612.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240612.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240613  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240613.payer, dw_tbl_20240613.payee
               Remote Filter: ((dw_tbl_20240613.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240613.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240613.payersec)::text = '0000'::text) AND ((dw_tbl_20240613.sec)::text = '
0000'::text) AND ((dw_tbl_20240613.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240613.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240613.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240614  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240614.payer, dw_tbl_20240614.payee
               Remote Filter: ((dw_tbl_20240614.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240614.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240614.payersec)::text = '0000'::text) AND ((dw_tbl_20240614.sec)::text = '
0000'::text) AND ((dw_tbl_20240614.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240614.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240614.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240615  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240615.payer, dw_tbl_20240615.payee
               Remote Filter: ((dw_tbl_20240615.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240615.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240615.payersec)::text = '0000'::text) AND ((dw_tbl_20240615.sec)::text = '
0000'::text) AND ((dw_tbl_20240615.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240615.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240615.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240616  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240616.payer, dw_tbl_20240616.payee
               Remote Filter: ((dw_tbl_20240616.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240616.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240616.payersec)::text = '0000'::text) AND ((dw_tbl_20240616.sec)::text = '
0000'::text) AND ((dw_tbl_20240616.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240616.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240616.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240617  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240617.payer, dw_tbl_20240617.payee
               Remote Filter: ((dw_tbl_20240617.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240617.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240617.payersec)::text = '0000'::text) AND ((dw_tbl_20240617.sec)::text = '
0000'::text) AND ((dw_tbl_20240617.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240617.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240617.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240618  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240618.payer, dw_tbl_20240618.payee
               Remote Filter: ((dw_tbl_20240618.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240618.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240618.payersec)::text = '0000'::text) AND ((dw_tbl_20240618.sec)::text = '
0000'::text) AND ((dw_tbl_20240618.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240618.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240618.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240619  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240619.payer, dw_tbl_20240619.payee
               Remote Filter: ((dw_tbl_20240619.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240619.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240619.payersec)::text = '0000'::text) AND ((dw_tbl_20240619.sec)::text = '
0000'::text) AND ((dw_tbl_20240619.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240619.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240619.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240620  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240620.payer, dw_tbl_20240620.payee
               Remote Filter: ((dw_tbl_20240620.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240620.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240620.payersec)::text = '0000'::text) AND ((dw_tbl_20240620.sec)::text = '
0000'::text) AND ((dw_tbl_20240620.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240620.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240620.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240621  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240621.payer, dw_tbl_20240621.payee
               Remote Filter: ((dw_tbl_20240621.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240621.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240621.payersec)::text = '0000'::text) AND ((dw_tbl_20240621.sec)::text = '
0000'::text) AND ((dw_tbl_20240621.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240621.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240621.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240622  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240622.payer, dw_tbl_20240622.payee
               Remote Filter: ((dw_tbl_20240622.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240622.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240622.payersec)::text = '0000'::text) AND ((dw_tbl_20240622.sec)::text = '
0000'::text) AND ((dw_tbl_20240622.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240622.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240622.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240623  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240623.payer, dw_tbl_20240623.payee
               Remote Filter: ((dw_tbl_20240623.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240623.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240623.payersec)::text = '0000'::text) AND ((dw_tbl_20240623.sec)::text = '
0000'::text) AND ((dw_tbl_20240623.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240623.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240623.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240624  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240624.payer, dw_tbl_20240624.payee
               Remote Filter: ((dw_tbl_20240624.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240624.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240624.payersec)::text = '0000'::text) AND ((dw_tbl_20240624.sec)::text = '
0000'::text) AND ((dw_tbl_20240624.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240624.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240624.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240625  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240625.payer, dw_tbl_20240625.payee
               Remote Filter: ((dw_tbl_20240625.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240625.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240625.payersec)::text = '0000'::text) AND ((dw_tbl_20240625.sec)::text = '
0000'::text) AND ((dw_tbl_20240625.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240625.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240625.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240626  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240626.payer, dw_tbl_20240626.payee
               Remote Filter: ((dw_tbl_20240626.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240626.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240626.payersec)::text = '0000'::text) AND ((dw_tbl_20240626.sec)::text = '
0000'::text) AND ((dw_tbl_20240626.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240626.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240626.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240627  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240627.payer, dw_tbl_20240627.payee
               Remote Filter: ((dw_tbl_20240627.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240627.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240627.payersec)::text = '0000'::text) AND ((dw_tbl_20240627.sec)::text = '
0000'::text) AND ((dw_tbl_20240627.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240627.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240627.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240628  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240628.payer, dw_tbl_20240628.payee
               Remote Filter: ((dw_tbl_20240628.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240628.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240628.payersec)::text = '0000'::text) AND ((dw_tbl_20240628.sec)::text = '
0000'::text) AND ((dw_tbl_20240628.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240628.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240628.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240629  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240629.payer, dw_tbl_20240629.payee
               Remote Filter: ((dw_tbl_20240629.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240629.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240629.payersec)::text = '0000'::text) AND ((dw_tbl_20240629.sec)::text = '
0000'::text) AND ((dw_tbl_20240629.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240629.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240629.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
         ->  Seq Scan on dw_tbl_20240630  (cost=0.00..125.00 rows=1000 width=1032)
               Output: dw_tbl_20240630.payer, dw_tbl_20240630.payee
               Remote Filter: ((dw_tbl_20240630.txndatetime >= '2024-05-30 00:00:00+05:30'::timestamp with time zone) AND (dw_tbl_20240630.txndatetim
e < '2024-07-01 00:00:00+05:30'::timestamp with time zone) AND ((dw_tbl_20240630.payersec)::text = '0000'::text) AND ((dw_tbl_20240630.sec)::text = '
0000'::text) AND ((dw_tbl_20240630.txntype)::text = 'FINANCIAL'::text))
               Filter: (((dw_tbl_20240630.Mode)::text <> ALL ('{11,12,13}'::text[])) AND ((dw_tbl_20240630.txnP)::text <> ALL ('{2
0,41,42,43,44,45,92}'::text[])))
(132 rows)

Will need to be set for entire cluster. Each tablet does it’s own compaction, so it needs to be set on all yb-tservers where there are tablets that the query will read from.