On Sun, Jun 19, 2011 at 10:10, Aroj George <[email protected]> wrote: > Yes, the map step is not redone, but I thought the reduce values are cached > in the internal non-leaf nodes? > Why then does Couch rerun the reduce every time for the exact same query ( > same group level etc..)
AFAIK, the reduce results are cached in a tree-shaped cache on-disk, where each member has the reduced results from all its child nodes. If your query does not exactly match a single parent node, the reduce query will have to skim a few parent nodes and reduce their results further (i.e. with rereduce=True). This certainly doesn't mean that each reduce query will have to calculate the full results from reducing all the map results, though. Cheers, Dirkjan
