Commit Graph

5487 Commits

Author SHA1 Message Date
Tatsuo Ishii edda70c0de Fix vacuum's memory consumption 1999-08-25 12:20:57 +00:00
Tatsuo Ishii 770d0786c2 Add new vpl_num_allocated_pages member to VPageListData.
It will keep track the number of pages allocated so that
vacuum could allocate twice of the previous allocation.
This will greatly reduce the total memory consumption of
vacuum.
1999-08-25 12:18:31 +00:00
Tom Lane 2b67dc5387 Alter AllocSet routines so that requests larger than
ALLOC_BIGCHUNK_LIMIT are always allocated as separate malloc() blocks,
and are free()d immediately upon pfree().  Also, if such a chunk is enlarged
with repalloc(), translate the operation into a realloc() so as to
minimize memory usage.  Of course, these large chunks still get freed
automatically if the alloc set is reset.
I have set ALLOC_BIGCHUNK_LIMIT at 64K for now, but perhaps another
size would be better?
1999-08-24 20:11:19 +00:00
Tom Lane 1b81fd7793 coerce_type() failed to guard against trying to convert a NULL
constant to a different type.  Not sure that this could happen in ordinary
parser usage, but it can in some new code I'm working on...
1999-08-24 00:09:56 +00:00
Tom Lane a23faeee83 Remove bogus code in oper_exact --- if it didn't find an exact
match then it tried for a self-commutative operator with the reversed input
data types.  This is pretty silly; there could never be such an operator,
except maybe in binary-compatible-type scenarios, and we have oper_inexact
for that.  Besides which, the oprsanity regress test would complain about
such an operator.  Remove nonfunctional code and simplify routine calling
convention accordingly.
1999-08-23 23:48:39 +00:00
Tom Lane e8140adb10 Further sort-order twiddling in optimizer: be smart about
case where ORDER BY and GROUP BY request the same sort order.
1999-08-22 23:56:45 +00:00
Tom Lane c9d040d85e Un-break code generated by ECPGRelease production. 1999-08-22 20:37:24 +00:00
Tom Lane 78114cd4d4 Further planner/optimizer cleanups. Move all set_tlist_references
and fix_opids processing to a single recursive pass over the plan tree
executed at the very tail end of planning, rather than haphazardly here
and there at different places.  Now that tlist Vars do not get modified
until the very end, it's possible to get rid of the klugy var_equal and
match_varid partial-matching routines, and just use plain equal()
throughout the optimizer.  This is a step towards allowing merge and
hash joins to be done on expressions instead of only Vars ...
1999-08-22 20:15:04 +00:00
Tom Lane db436adf76 Major revision of sort-node handling: push knowledge of query
sort order down into planner, instead of handling it only at the very top
level of the planner.  This fixes many things.  An explicit sort is now
avoided if there is a cheaper alternative (typically an indexscan) not
only for ORDER BY, but also for the internal sort of GROUP BY.  It works
even when there is no other reason (such as a WHERE condition) to consider
the indexscan.  It works for indexes on functions.  It works for indexes
on functions, backwards.  It's just so cool...

CAUTION: I have changed the representation of SortClause nodes, therefore
THIS UPDATE BREAKS STORED RULES.  You will need to initdb.
1999-08-21 03:49:17 +00:00
Tom Lane 5588c559e6 Cleanups for int8: guard against null inputs in comparison
operators (and some other places), fix rangechecks in int8 to int4
conversion (same problem we recently figured out in pg_atoi).
1999-08-21 03:06:58 +00:00
Tom Lane d91baea025 Ooops ... I had left some test coding in selfuncs.c that
failed on 'field < textconstant' ...
1999-08-21 00:56:18 +00:00
Bruce Momjian ca5c10f778 Update TODO list. 1999-08-18 15:11:52 +00:00
Tatsuo Ishii 02efaa14e5 Old multi-byte bug. Forgot to rename #ifdef MB to #ifdef MULTIBYTE
Now SET NAMES working again...
1999-08-18 13:04:45 +00:00
Tom Lane abee4c299f Remove extraneous SeqScan node that make_noname was inserting
above a Sort or Materialize node.  As far as I can tell, the only place
that actually needed that was set_tlist_references, which was being lazy
about checking to see if it had a noname node to fix or not...
1999-08-18 04:15:16 +00:00
Tom Lane 6defe4949e Add script that runs the regression tests with all valid
combinations of query-plan-type backend options.  Good for testing
planner/optimizer.  Tedious, though.
1999-08-17 21:21:22 +00:00
Bruce Momjian 898b21267d Add missing docs semicolon. 1999-08-17 17:31:11 +00:00
Tom Lane ed3f69168f EXPLAIN didn't know about 'Materialize' plan nodes. 1999-08-16 23:47:23 +00:00
Tom Lane 91f82de48a Assign sort keys properly when there are duplicate entries in
pathkey list --- corrects misbehavior seen with multiple mergejoin clauses
mentioning same variable.
1999-08-16 23:07:20 +00:00
Bruce Momjian 55179388f9 Typo fix 1999-08-16 20:32:34 +00:00
Bruce Momjian 972124091d I've sent 3 mails to pgsql-patches. There are two files, one for doc
and
for src/data directories, and one minor patch for doc/README.locale.
   Please apply.

Oleg.
1999-08-16 20:27:19 +00:00
Bruce Momjian c5d0a1bc42 Fix for perl5 on BSD/OS. 1999-08-16 20:12:12 +00:00
Bruce Momjian aa2cc6ebbe Change >& to > and 2>&1. 1999-08-16 19:59:25 +00:00
Bruce Momjian e69a997d02 Allow BSD yacc and bison to compile pl code. 1999-08-16 19:57:21 +00:00
Tom Lane e6381966c1 Major planner/optimizer revision: get rid of PathOrder node type,
store all ordering information in pathkeys lists (which are now lists of
lists of PathKeyItem nodes, not just lists of lists of vars).  This was
a big win --- the code is smaller and IMHO more understandable than it
was, even though it handles more cases.  I believe the node changes will
not force an initdb for anyone; planner nodes don't show up in stored
rules.
1999-08-16 02:17:58 +00:00
Tom Lane 08320bfb22 Small updates to #include lists for pending optimizer checkin. 1999-08-16 02:10:13 +00:00
Tom Lane c9b128fcdb Move funcid_get_rettype() to lsyscache. 1999-08-16 02:08:59 +00:00
Tom Lane b1baf1ff60 Add get_func_rettype() to general-use lsyscache routines,
since it's now needed in both optimizer and parser.
1999-08-16 02:06:25 +00:00
Tatsuo Ishii bab13a70ff Fix for Win32 making problem with MB enabled.
Patches created by Hiroki Kataoka.
1999-08-16 02:04:05 +00:00
Thomas G. Lockhart 3cfd56fcf6 Repair the check for redundant UNIQUE and PRIMARY KEY indices.
Also, improve it so that it checks for multi-column constraints.
Thanks to Mark Dalphin <mdalphin@amgen.com> for reporting the problem.
1999-08-15 06:46:49 +00:00
Tom Lane 288373f5a4 LispUnion fix changes output ordering for inheritance tests. 1999-08-14 19:30:21 +00:00
Tom Lane 51e29a2be3 LispUnion routine didn't generate a proper union: anytime
l2 contained more than one entry, there would be duplicates in the output
list.  Miscellaneous code beautification in other routines, too.
1999-08-14 19:29:35 +00:00
Bruce Momjian 448d1ab0ad Update TODO list. 1999-08-13 16:56:04 +00:00
Tom Lane 47f18ec702 Update comments about pathkeys. 1999-08-13 01:17:16 +00:00
Tom Lane 8f9f6e51a8 Clean up optimizer's handling of indexscan quals that need to be
commuted (ie, the index var appears on the right).  These are now handled
the same way as merge and hash join quals that need to be commuted: the
actual reversing of the clause only happens if we actually choose the path
and generate a plan from it.  Furthermore, the clause is only reversed in
the 'indexqual' field of the plan, not in the 'indxqualorig' field.  This
allows the clause to still be recognized and removed from qpquals of upper
level join plans.  Also, simplify and generalize match_clause_to_indexkey;
now it recognizes binary-compatible indexes for join as well as restriction
clauses.
1999-08-12 04:32:54 +00:00
Tom Lane aae034d28c Add commentary to show that even though ExecInitIndexScan()
contains much code that looks like it will handle indexquals with the index
key on either side of the operator, in fact indexquals must have the index
key on the left because of limitations of the ScanKey machinery.  Perhaps
someone will be motivated to fix that someday...
1999-08-12 00:42:43 +00:00
Bruce Momjian 6075717df0 Update TODO list. 1999-08-10 16:56:54 +00:00
Tom Lane 2ae51c86c9 Minor cleanups and code beautification; eliminate some
routines that are now dead code.
1999-08-10 03:00:15 +00:00
Tom Lane 4a1c5cb953 Revise create_nestloop_node's handling of inner indexscan to
work under a wider range of scenarios than it did --- it formerly did not
handle a multi-pass inner scan, nor cases in which the inner scan's
indxqualorig or non-index qual contained outer var references.  I am not
sure that these limitations could be hit in the existing optimizer, but
they need to be fixed for future expansion.
1999-08-10 02:58:56 +00:00
Bruce Momjian 158fd5f1c4 > > Prevent sorting if result is already sorted
> >
> > was implemented by Jan Wieck.
> > His work is for ascending order cases.
> >
> > Here is a patch to prevent sorting also in descending
> > order cases.
> > Because I had already changed _bt_first() to position
> > backward correctly before v6.5,this patch would work.
> >
Hiroshi Inoue
Inoue@tpf.co.jp
1999-08-09 06:20:27 +00:00
Tom Lane 5efe31214a Clean up tlist.c tree-walking routines with
expression_tree_mutator.
1999-08-09 05:34:13 +00:00
Tom Lane 14f84cd821 Store -1 in attdisbursion to signal 'no duplicates in column'.
Centralize att_disbursion readout logic.
1999-08-09 03:16:47 +00:00
Tom Lane 5af4b04f31 Move get_attdisbursion to lsyscache. Clean up get_typdefault. 1999-08-09 03:13:31 +00:00
Tom Lane e9054829a2 Update comments about attdisbursion. NO code change. 1999-08-09 02:45:56 +00:00
Vadim B. Mikheev 1ecb43a40c Re-use free space on index pages with duplicates. 1999-08-09 01:39:19 +00:00
Tom Lane 10d6d411a8 Rewrite fix_indxqual_references, which was entirely bogus for
multi-scan indexscan plans; it tried to use the same table-to-index
attribute mapping for all the scans, even if they used different indexes.
It would klugily work as long as OR indexquals never used multikey indexes,
but that's not likely to hold up much longer...
1999-08-09 01:01:42 +00:00
Tom Lane ecef2caae9 Clean up routines in setrefs.c by replacing individual tree
walking logic with expression_tree_walker/mutator calls.
1999-08-09 00:56:05 +00:00
Tom Lane 6bc601b648 Create a standardized expression_tree_mutator support routine
to go along with expression_tree_walker.  (_walker is not suitable for
routines that need to alter the tree structure significantly.)  Other minor
cleanups in clauses.c.
1999-08-09 00:51:26 +00:00
Bruce Momjian f0b651ac6b replace #Include . 1999-08-09 00:08:52 +00:00
Tom Lane 4488b69b4c Fix nbtree's failure to clear BTScans list during xact abort.
Also, move responsibility for calling vc_abort into main xact.c list of
things-to-call-at-abort.  What in the world was it doing down inside of
TransactionIdAbort()?
1999-08-08 20:12:52 +00:00
Tom Lane fb491a5854 For a unique-key attribute (no duplicate values), vacuum analyze
was recording a disbursion of 0, not the correct value 1/numberOfRows.
1999-08-08 17:13:10 +00:00