BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASNE
Obsidian | Level 7

Hi Gurus,

 

i have three tables with one common key, once i pull those tables from the left pane,

 

i) is it better to join it through Query Builder and set filter (condition) at once (so that the DB server handle all queue ?)

 

or

 

ii) pull each table and filter fields (data -> filter, select necessary fields) first, then creates sas temp file and join them one by one

 

Which one is more effective ?

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20
For most cases option 1 is preferred, at least from a performance point of view. But since every environment is unique I sugest yubtry both and compare.
Data never sleeps

View solution in original post

6 REPLIES 6
SASNE
Obsidian | Level 7

Hi Gurus,


i have three tables with one common key, once i pull those tables from the left pane,


i) is it better to join it through Query Builder and set filter (condition) at once (so that the DB server handle all queue ?)


or


ii) pull each table and filter fields (data -> filter, select necessary fields) first, then creates sas temp file and join them one by one


Which one is more effective ?


Thanks  

Joining at once in QueryBuilder at once with Filtering

Shmuel
Garnet | Level 18

As much as I know qury builder will generate SQL program.

In this case, it will anyway join first 2 tables and then join the 3rd to the intermediate one.

So my advise is to do whatever is easier for you.

SASNE
Obsidian | Level 7

Hi Shmuel,

 

Thank you for your help.

 

So that if i pull the 2 tables from SQLserver on left pane, then use Query builder join them , does it run the queue on the DB Server side ?

 

i know that if i let say filter the table first, then the new dataset will be save as Sas7dat format in Work folder, then any action later on will be on SAS server side.

 

Am i right ?

 

Thank you for your advice


After Filter.PNGTables.PNG
Shmuel
Garnet | Level 18

You are probably working on SAS EG. My experience with query builder is limited,

but if you can post the log I would be able to answer your question.

LinusH
Tourmaline | Level 20
For most cases option 1 is preferred, at least from a performance point of view. But since every environment is unique I sugest yubtry both and compare.
Data never sleeps

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2221 views
  • 2 likes
  • 4 in conversation