1. 06 12月, 2010 2 次提交
    • P
      951d7861
    • T
      Reduce memory consumption inside inheritance_planner(). · d1001a78
      Tom Lane 提交于
      Avoid eating quite so much memory for large inheritance trees, by
      reclaiming the space used by temporary copies of the original parsetree and
      range table, as well as the workspace needed during planning.  The cost is
      needing to copy the finished plan trees out of the child memory context.
      Although this looks like it ought to slow things down, my testing shows
      it actually is faster, apparently because fewer interactions with malloc()
      are needed and/or we can do the work within a more readily cacheable amount
      of memory.  That result might be platform-dependent, but I'll take it.
      
      Per a gripe from John Papandriopoulos, in which it was pointed out that the
      memory consumption actually grew as O(N^2) for sufficiently many child
      tables, since we were creating N copies of the N-element range table.
      d1001a78
  2. 05 12月, 2010 1 次提交
    • T
      Fix two small bugs in new gistget.c logic. · d1f5a92e
      Tom Lane 提交于
      1. Complain, rather than silently doing nothing, if an "invalid" tuple
      is found on a leaf page.  Per off-list discussion with Heikki.
      
      2. Fix oversight in code that removes a GISTSearchItem from the search
      queue: we have to reset lastHeap if this was the last heap item in the
      parent GISTSearchTreeItem.  Otherwise subsequent additions will do the
      wrong thing.  This was probably masked in early testing because in typical
      cases the parent item would now be completely empty and would be deleted on
      next call.  You'd need a queued non-leaf page at exactly the same distance
      as a heap tuple to expose the bug.
      d1f5a92e
  3. 04 12月, 2010 6 次提交
  4. 03 12月, 2010 11 次提交
  5. 01 12月, 2010 1 次提交
    • T
      Prevent inlining a SQL function with multiple OUT parameters. · 225f0aa3
      Tom Lane 提交于
      There were corner cases in which the planner would attempt to inline such
      a function, which would result in a failure at runtime due to loss of
      information about exactly what the result record type is.  Fix by disabling
      inlining when the function's recorded result type is RECORD.  There might
      be some sub-cases where inlining could still be allowed, but this is a
      simple and backpatchable fix, so leave refinements for another day.
      Per bug #5777 from Nate Carson.
      
      Back-patch to all supported branches.  8.1 happens to avoid a core-dump
      here, but it still does the wrong thing.
      225f0aa3
  6. 30 11月, 2010 1 次提交
    • T
      Simplify and speed up mapping of index opfamilies to pathkeys. · c0b5fac7
      Tom Lane 提交于
      Formerly we looked up the operators associated with each index (caching
      them in relcache) and then the planner looked up the btree opfamily
      containing such operators in order to build the btree-centric pathkey
      representation that describes the index's sort order.  This is quite
      pointless for btree indexes: we might as well just use the index's opfamily
      information directly.  That saves syscache lookup cycles during planning,
      and furthermore allows us to eliminate the relcache's caching of operators
      altogether, which may help in reducing backend startup time.
      
      I added code to plancat.c to perform the same type of double lookup
      on-the-fly if it's ever faced with a non-btree amcanorder index AM.
      If such a thing actually becomes interesting for production, we should
      replace that logic with some more-direct method for identifying the
      corresponding btree opfamily; but it's not worth spending effort on now.
      
      There is considerably more to do pursuant to my recent proposal to get rid
      of sort-operator-based representations of sort orderings, but this patch
      grabs some of the low-hanging fruit.  I'll look at the remainder of that
      work after the current commitfest.
      c0b5fac7
  7. 29 11月, 2010 3 次提交
  8. 28 11月, 2010 2 次提交
  9. 27 11月, 2010 13 次提交