2

In a DB2 Explain Plan, what does TBSCAN GENROW (line 5 below) mean?

SELECT STATEMENT ( Estimated Costs =  1.811E+03 [timerons] )
   1 RETURN
      2 NLJOIN
          3 [O] TBSCAN
              4 SORT
                  5 TBSCAN GENROW
          6 [I] FETCH EKKO
              7 IXSCAN EKKO~1 #key columns:  2

The IBM docs say GENROW is

"A built-in function that generates a table of rows, using no input from tables, indexes, or operators"

What does that mean from a performance perspective?

Also, this is in an SAP system if that matters.

1 Answer 1

3

I think I've figured it out. GENROW means it's creating a temporary table which is then joined to an actual table. This is usually done when the query contains an IN (...) statement. Specific to SAP, this is usually done for FOR ALL ENTRIES queries.

2
  • Interesting... But... the question - what's the actual performance impact?
    – user1459
    Commented Apr 11, 2011 at 22:26
  • In SQL Server, it would mean creating a row that doesn't come from a table
    – Gaius
    Commented Apr 12, 2011 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.