Ryan Peters
10/03/2024, 2:52 PMINNER JOIN (SELECT * FROM <TABLE_SCHEMA> WHERE `wdf__tenant_id` = "<TENANT_NAME>")
When there's a clear filter for date after it.
`t`.`case_opened` >= TO_TIMESTAMP("2024-09-25", "yyyy-MM-dd")
AND `t`.`case_opened` < (TO_TIMESTAMP("2024-09-25", "yyyy-MM-dd") + (INTERVAL '1 day'))
So I'm curious why this might be the case? Just even inserting the date filter into the select * from portion of this generated query reduces runtime by nearly 20%.Joseph Heun
10/03/2024, 3:15 PMRyan Peters
10/03/2024, 3:17 PMRyan Peters
10/03/2024, 4:55 PMJoseph Heun
10/03/2024, 5:05 PMFrancisco Antunes
10/07/2024, 2:37 PMwdf__tenant_id
). I tested on my end, and the type of SELECT * WHERE <column_name> IN <value>
is expected when using this feature - which makes sense, since it’s intended as a security/privacy feature and needs to apply to the entirety of the column, lest a tenant have access to data they shouldn’t.
So these queries are indeed a core part of the WDF feature, and cannot be avoided while that is in place.Ryan Peters
10/07/2024, 2:44 PMselect *
is that there's a date filter which I would assume comes from the dashboard date config already. Wouldn't it make sense to have that auto-populate within that select *
range? Because we're seeing examples where this is already grabbing 10M rows of data before reducing, and drastically slows things down. (We have clients that within year easily clear 50M rows of data in our schema)Francisco Antunes
10/07/2024, 3:01 PMDoug Creighton
10/07/2024, 7:30 PMDoug Creighton
10/09/2024, 3:03 PMFrancisco Antunes
10/09/2024, 3:18 PMDoug Creighton
10/11/2024, 8:04 PMwdf__tenant_id
= "TENANT_NAME")
Because we have set it up the WDF filter on that table
If we instead had a table with all our clients that is a 1:N join with our aggregation table (we just have the 1)
Dim_client
Client 1 WDF_filter
Client 2 WDF_FILTER
_______
Aggregation table
ID: DFSFSD
Client_it = {WDF_FILTER}
Sales:
Purchases:
.....
items:
and then we join the client_id with the WDF_filter
Then we did a 1:N join between these tables. I would have thought that INNER JOIN Would change from our aggregation table to the DIM table but with the join it would auto filter the aggregation table. This would make that inner join on 100 rows vs 1 Billion rows.Francisco Antunes
10/15/2024, 9:11 AMProduct Category
attribute on the Product
dataset, which has a 1:N connection with the Order lines
dataset (screenshot #1).
However, when I create a simple visualization with the sum of Order Line ID
, the WDF doesn’t work (note that I even have the Category
attribute as the only option on the filter; It’s set to “All”, though, so even though only 1 option is available, it still doesn’t apply the WDF to the viz, only to the filter, if that makes sense). That’s shown in the second Screenshot.
Then, I actually add the Category
attribute to the visualization itself, which then leads to the INNER JOIN, thus resulting in the WDF applying. I could have used any of the attributes from the Product
dataset, in fact, with similar results. That’s what I meant by the WDF not propagating - it only applies to the original dataset, so any other datasets down the line will not be affected by it without actually enforcing the join by slicing or filtering the visualization by an attribute from the dataset where WDF is set up (in your example, the DIM table).
So I’m afraid that your idea with the DIM table wouldn’t quite work out as-is. You’d need to find a way to reference this table during report computation to ensure the WDF applies - be it by adding an attribute from it to the report, or even having it set as a locked/hidden filter on the Dashboard the end-users actually visit.
I hope this helps explain the feature in more detail!Doug Creighton
10/17/2024, 4:41 PM