iTVF: Better way to code this?

  • 1000 rows / sec is still craply slow. But if you're happy... ;-).

    For 19 seconds, I'd expect to process at the very least 1 M rows.

  • I suspect most of those 14 seconds are from pulling the rows from DB2 into the initial SQL Server temp table - that's always our bottleneck and at this point, there's not much our team can do about it (changes are hopefully afoot on that front). It's so standard that I've become used to multi-second response time. Sad, I know.

  • Pam Brisjar (9/21/2011)


    Drew: Your solution, unfortunately, didn't work. Seems like a select statement in a CASE isn't allowed.

    Actually a SELECT statement should be allowed as long as it only returns a single value. I forgot to include a TOP 1 in my code. It's already returning a single expression, so forcing it to return a single row should fix that problem. I don't know if it will improve upon the solution that you have already found.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • That makes a lot of sense, Drew. I think I'll stick with my solution as I think it's more readable and it looks to be working well, but I'll definitely keep this trick technique in mind for the future. I can see where it could come in quite handy.

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply