Investigate issue with BlitzCache and Table-valued function joins
Script to repro:
USE [StackOverflow]
GO
CREATE FUNCTION [dbo].[BC_MSTVF_1] ( @uid INT )
RETURNS @Out TABLE (ID BIGINT, [BadgeCount] BIGINT )
WITH SCHEMABINDING
AS
BEGIN
INSERT INTO @Out
(
[ID],
[BadgeCount]
)
SELECT [b].[UserId], COUNT_BIG(*) AS [BadgeCount]
FROM [dbo].[Badges] AS [b]
WHERE [b].[UserId] = @uid
GROUP BY [b].[UserId];
RETURN;
END;
GO
SELECT
TOP 10000 *
FROM
[dbo].[Users] AS [u]
LEFT JOIN [dbo].[BC_MSTVF_1] (0) AS [bm]
ON [u].[Id] = [bm].[ID]

XML shows:
<RelOp AvgRowSize="9" EstimateCPU="0.000100157" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="100" LogicalOp="Table-valued function" NodeId="1" Parallel="false" PhysicalOp="Table-valued function" EstimatedTotalSubtreeCost="0.000100157">
BlitzCache is looking for: relop.exist('/p:RelOp[contains(@LogicalOp, "Join")]/*/p:RelOp[(@LogicalOp[.="Table-valued function"])]') AS tvf_join
There are no other references to TVFs in the XML.
This doesn't seem to manifest at all with inline table valued functions.
USE [StackOverflow]
GO
CREATE FUNCTION [dbo].[BC_ITVF_1] ( @uid INT )
RETURNS TABLE
WITH SCHEMABINDING
AS
RETURN
SELECT [b].[UserId], COUNT_BIG(*) AS [BadgeCount]
FROM [dbo].[Badges] AS [b]
WHERE [b].[UserId] = @uid
GROUP BY [b].[UserId];
GO
SELECT
TOP 10000 *
FROM
[dbo].[Users] AS [u]
LEFT JOIN [dbo].[BC_ITVF_1] (0) AS [bm]
ON [u].[Id] = [bm].[UserId]
FWIW, I've seen this work correctly with some background/system queries, but I'm not sure what's different there.Here's an example. Plan XML is attached.

This isn't going anywhere.