Actually I think db.getdocumentbyunid is slower. The reason being is that views are indexed. So when you view.getdocumentbykey it's using the index, which by nature is structured for fast lookups. But I could be completely wrong and I guess it depends on the design of your app (how often views are indexed, selection formulas and so on).
Actually I think db.getdocumentbyunid is slower. The reason being is that views are indexed. So when you view.getdocumentbykey it's using the index, which by nature is structured for fast lookups. But I could be completely wrong and I guess it depends on the design of your app (how often views are indexed, selection formulas and so on).