Skip to content

Commit

Permalink
Indicate full scans in :profile full output
Browse files Browse the repository at this point in the history
Reviewed By: malanka

Differential Revision: D64035058

fbshipit-source-id: 20059bcdf0687abd580a39c0d47f010e789c1b41
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Oct 9, 2024
1 parent 2751dc9 commit 7b70448
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion glean/shell/Glean/Shell.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1001,13 +1001,16 @@ runUserQuery sQuery = do
]
++
[ vcat $ "Facts searched:" :
[ pretty (printf "%40s : %d" (show (pretty ref)) count :: String)
[ pretty (printf "%40s : %d%s" (show (pretty ref)) count
(if ref `elem` scans then " (full scan)" else "" :: String)
:: String)
| (pid, count) <- sortOn (Down . snd) $ Map.toList m
, Just info <- [schemaInfo]
, Just ref <- [Map.lookup pid (Thrift.schemaInfo_predicateIds info)] ]
| stats == FullStats
, Just stats <- [finalStats]
, Just m <- [Thrift.userQueryStats_facts_searched stats]
, let scans = Thrift.userQueryStats_full_scans stats
]
++
[ vcat $ if Thrift.userQueryStats_result_count stats < fromIntegral limit
Expand Down

0 comments on commit 7b70448

Please sign in to comment.