Home

Power Query Join Transform on a Very Large Table

%3CLINGO-SUB%20id%3D%22lingo-sub-224987%22%20slang%3D%22en-US%22%3EPower%20Query%20Join%20Transform%20on%20a%20Very%20Large%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-224987%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20trouble%20with%20getting%20data%20from%20a%20very%20large%20Oracle%20SQL%20table.%26nbsp%3B%20It%20seems%20like%20Query%20Folding%20may%20not%20be%20occurring%20with%20my%20left%20inner%20join%2C%20so%20the%20server%20is%26nbsp%3Breturning%20all%20%3CEM%3E519%26nbsp%3Bmillion%3C%2FEM%3E%26nbsp%3Brows%20of%20data%20from%20the%20main%20table%2C%20rather%20than%20just%20the%20records%20I%20want%20(records%20from%20the%20last%2030%20days).%26nbsp%3B%20But%20before%20I%20can%20filter%20by%20date%20range%2C%20I%20have%20to%20join%20the%20main%20table%20via%20the%20Date_ID%20column%20with%20the%20Date%20table%20(which%20itself%20has%26nbsp%3B18k%20rows)%2C%20expand%20the%20actual%20date%20column%2C%20and%20then%20filter%20by%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I'm%20in%20the%20editor%2C%20I%20seem%20to%20remember%20joins%20like%20this%20would%20preview%20quickly%2C%20I%20thought%20it%20was%20because%20it%20was%20only%20using%20a%20small%20subset%20(say%20200%20rows)%20of%20data%2C%20or%20maybe%20it%20was%20using%20query%20folding%20so%20the%20server%20handled%20the%20join%20and%20where-clause%2C%20and%20only%20returned%20back%20the%20small%20set%20I%20wanted.%26nbsp%3B%20But%20now%20it's%20clear%20that%20isn't%20happening.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-224987%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analytics%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeed%20Help%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-851176%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Join%20Transform%20on%20a%20Very%20Large%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-851176%22%20slang%3D%22en-US%22%3EHello%20Shawn%2C%3CBR%20%2F%3EHere%20is%20a%20good%20reference%20for%20your%20problem%3A%20%3CA%20href%3D%22https%3A%2F%2Fwww.thebiccountant.com%2F2019%2F04%2F18%2Fquery-folding-joinkind-inner-gotcha-power-bi-power-query%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.thebiccountant.com%2F2019%2F04%2F18%2Fquery-folding-joinkind-inner-gotcha-power-bi-power-query%2F%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ESince%20you%20are%20dealing%20with%20a%20very%20large%20data%2C%20on%20the%20beginning%20of%20your%20large%20table%20Keep%20the%20first%20(%20or%20last%20since%20you%20want%20the%20latest%20data)%201k%20rows%2C%20then%20perform%20the%20merge%20with%20the%20date%20table.%20after%20performing%20the%20merge%2C%20expand%20the%20date%20table%2C%20and%20perform%20your%20filter.%3CBR%20%2F%3E%3CBR%20%2F%3Eafter%20that%2C%20remove%20the%20%22Keep%20Rows%22%20step%2C%20and%20the%20query%20folding%20should%20be%20fine%20again.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-851209%22%20slang%3D%22en-US%22%3ERe%3A%20Power%20Query%20Join%20Transform%20on%20a%20Very%20Large%20Table%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-851209%22%20slang%3D%22en-US%22%3EI%20appreciate%20the%20response%2C%20however%20the%20root%20issue%20was%20addressed%20in%20a%20update%20for%20the%20Oracle%20connector%2C%20in%20the%201903%20release.%20So%20it's%20now%20a%20moot%20point.%3CBR%20%2F%3E%3CBR%20%2F%3EI'd%20also%20like%20to%20thank%20the%20development%20team%2C%20who%20responded%20to%20my%20in-app%20feedback%20from%20the%20frown%20icon%2C%20they%20emailed%20me%20directly%20to%20let%20me%20know%20the%20fix%20was%20in%20the%20pipeline%20and%20when%20the%20release%20date%20would%20be.%20Very%20awesome%20service.%3C%2FLINGO-BODY%3E
Shawn Keene
Occasional Contributor

I'm having trouble with getting data from a very large Oracle SQL table.  It seems like Query Folding may not be occurring with my left inner join, so the server is returning all 519 million rows of data from the main table, rather than just the records I want (records from the last 30 days).  But before I can filter by date range, I have to join the main table via the Date_ID column with the Date table (which itself has 18k rows), expand the actual date column, and then filter by it.

 

When I'm in the editor, I seem to remember joins like this would preview quickly, I thought it was because it was only using a small subset (say 200 rows) of data, or maybe it was using query folding so the server handled the join and where-clause, and only returned back the small set I wanted.  But now it's clear that isn't happening.

2 Replies
Hello Shawn,
Here is a good reference for your problem: https://www.thebiccountant.com/2019/04/18/query-folding-joinkind-inner-gotcha-power-bi-power-query/

Since you are dealing with a very large data, on the beginning of your large table Keep the first ( or last since you want the latest data) 1k rows, then perform the merge with the date table. after performing the merge, expand the date table, and perform your filter.

after that, remove the "Keep Rows" step, and the query folding should be fine again.
I appreciate the response, however the root issue was addressed in a update for the Oracle connector, in the 1903 release. So it's now a moot point.

I'd also like to thank the development team, who responded to my in-app feedback from the frown icon, they emailed me directly to let me know the fix was in the pipeline and when the release date would be. Very awesome service.