Link to home
Start Free TrialLog in
Avatar of justinfilmer
justinfilmer

asked on

SQL Table Functions - do they scale well, is there an efficient way to emulate them in MySQL

I have an application that groups orders in many different ways (by company, store, warehouse, account). I have used a MS SQL table function to gather the appropriate account IDs and join that table function to my primary order table to make sure the user is exposed to the appropriate orders. This has worked well as it saves me from have to have 20 variations of every select stored proc in the application but I have two questions -

Is this scale-able if the database grows up to 50 million rows in the order table?

Is there a way to do this in MySQL?
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It depends.  In-line TVFs are extremely efficient and will scale nicely.  Multi-line TVFs are inefficient and will not scale well at all.

I have no idea for MySQL.
Avatar of justinfilmer
justinfilmer

ASKER

I was unaware that stored procs using table functions would not cache. I will post again to try to find my options in MySQL.