CF - QoQ vs Query

前端 未结 5 442
不知归路
不知归路 2021-01-18 23:57

I\'ve got a notion that calling a query of queries is faster than a query from database, because the slowdown is in the communication between cf and the db. Is this true.

5条回答
  •  庸人自扰
    2021-01-19 00:20

    Times to use QofQ

    • When you have two datasources and for various reasons you can use linked servers
    • When the data comes in via WDDX or JSON and you have to do a join
    • When it is practical to store data in a cached query and do QofQ against the cached query
    • When you have to join the result of a directoryList() against a data base

    Times to not use QofQ

    • When you can load the data into a struct instead
    • When doing doing a massive number of iterations
    • When the one of source data sets is very large
    • When you need to do a left, right, or outer join

    For more details see

    http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0e4fd-7ff0.html

    This is for CF 9 but QofQ has been about the same since CF 6

提交回复
热议问题