• Jeff Moden - Thursday, January 10, 2019 10:10 PM

    I guess I don't know what you mean.  iTVFs will use the indexes of underlying tables just fine and, if used properly, will come into play just fine for joins and the like.  I DO agree, however, that using Indexed Views is an incredible method for pre-aggregating data if you understand the effects they will have if you have rapidly changing table data that must be processed by Indexed Views.

    Jeff,  you can write an ITVF that reads from a view, including an indexed view, not just tables.   In fact, if the function references multiple tables and a suitable indexed view exists, the ITVF may use it automatically.     

    The point is that sometimes indexed views across multiple tables can save time and i/o by eliminating joins altogether, and that inline table functions can take advantage of indexed views.    ITVFs and indexed views aren't mutually exclusive.   They play nicely together, with the indexed view providing the structure and the ITVF providing control through parameters.      I hope this is a better explanation.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills