sql server - Query hint for insert from stored procedure -
i'm running sql server 2014.
in following code, have temp table (defined earlier in code) being filled stored procedure. of parameters stored procedure standard data types, @grouplayoutspecifications
table variable accepts small heap table joined within stored procedure.
insert #standardizedresponses exec rpt.usp_querybuilder_gatherstandardizedresponses @member, @orgunits, @groups, @measurename, @startdate, @enddate, @instrumenttypeids, @backgrounddataids, @grouplayoutspecifications;
the problem i'm having query engine isn't able estimate number of rows stored procedure return. typical estimate return of 1 row, actual return of closer 200k rows. believe causing tempdb spillover later in plan.
is table-type parameter causing query engine grief? if so, how might around that?
similarly, there way hint sql server following query result in larger expected row count?
i've researched quite bit through things msdn, site, sql authority, , others, , hoping here can me tune this.
if need more information supply reasonable answer, let me know might need.
cheers,
joe
Comments
Post a Comment