Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rucksack
New Member

How do native queries effect evaluation during load and refresh?

Hello,

 

I am using the Odbc.Query to access a vendor's MySQL database. My query looks something like this:

 

SELECT x.a, x.b, z.c, z.d, w.e, w.f, z.g
FROM z
    JOIN y ON y.a = z.a
    JOIN x ON x.b = z.b
    JOIN w ON w.b = z.b
WHERE z.c = 1
    AND z.a IS NOT NULL
    AND w.e IS NOT NULL
    AND z.g = 2
    AND CHAR_LENGTH(w.f) = 3
 
The tables are pretty big, and I expect tens of thousands of rows as the result of this query.
 
The thing is, that if I run something like above, Power BI sits on 'Evaluating' forever. If I add a limit clause, like 'LIMIT 20000', it runs pretty quickly. Confusingly other queries I run return millions of rows and I don't have this issue with all of them
 
Can someone explain to me why this is? I'd like to optimize my queries for Power BI, but I don't understand what's happening during evaluation.
 
Thanks
1 REPLY 1
otravers
Community Champion
Community Champion

I'd avoid running native queries if I can. If you want to leverage your database's capabilities, create views in MySQL that are optimized for BI purposes. Also, from the multiple joins in your query I wonder about what you're trying to load in Power BI. Are you trying to create on big table, or is this part of a star schema?

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.