Raghu Koratagere
02/12/2025, 12:52 PMl.hs_crn = 'HS-11913514'
• user_tbl has 11490324 rows
• leads_wide_tbl has 11490334 rows and invertedIndexColumns is hs_crn
Query 1 (“timeUsedMs”: 4276):
select
u.user_name,
l.lead_name,
l.hs_crn
from user_tbl u
join leads_wide_tbl l on l.user_id = u.user_id
where l.last_updated_on >= 1727634600000
and l.city = 'BANGALORE'
and l.hs_crn = 'HS-11913514'
limit 100
Query 2(timeUsedMs”: 897):
select
u.user_name,
l.lead_name,
l.hs_crn
from user_tbl u
join leads_wide_tbl l on l.user_id = u.user_id
where l.last_updated_on >= 1727634600000
and l.city = 'BANGALORE'
limit 100Raghu Koratagere
02/12/2025, 12:57 PMExecution Plan
LogicalSort(offset=[0], fetch=[100])
PinotLogicalSortExchange(distribution=[hash], collation=[[]], isSortOnSender=[false], isSortOnReceiver=[false])
LogicalSort(fetch=[100])
LogicalProject(user_name=[$1], lead_name=[$3], hs_crn=[$2])
LogicalJoin(condition=[=($4, $0)], joinType=[inner])
PinotLogicalExchange(distribution=[hash[0]])
LogicalProject(user_id=[$9], user_name=[$10])
LogicalTableScan(table=[[default, nb_user_tbl]])
PinotLogicalExchange(distribution=[hash[2]])
LogicalProject(hs_crn=[$21], lead_name=[$33], user_id=[$52])
LogicalFilter(condition=[AND(>=($32, 1727634600000), =($10, _UTF-8'BANGALORE'), =($21, _UTF-8'HS-11913514'))])
LogicalTableScan(table=[[default, hs_leads_wide_tbl]])Bolek Ziobrowski
02/13/2025, 12:20 PMSET explainPlanVerbose=true; as that should show if index is actually used in leaf (bottom-most) stage.
You can see what took the most time by inspecting stage stats, see https://docs.pinot.apache.org/users/user-guide-query/multi-stage-query/understanding-stage-stats .Bolek Ziobrowski
02/13/2025, 1:11 PM