Commit Graph

  • 8759f175db Performance improvements in cnfify(): get rid of exponential space consumption in pull_args, and avoid doing the full CNF transform on operands of operator clauses, where it's really not particularly helpful. This answers the TODO item about large numbers of OR clauses, at least partially. I was able to do a ten-thousand-OR-clause query with about 20Mb memory consumption ... it took an obscenely long time, but it worked... Tom Lane 1999-09-07 03:47:06 +00:00
  • 85712da90d Mike Ansley's fixes for long queries. This change just corrects flex myinput() routine so that it doesn't assume there is only one bufferload of data. We still have the issue of getting rid of YY_USES_REJECT so that the scanner can cope with tokens larger than its initial buffer size. Tom Lane 1999-09-07 00:13:27 +00:00
  • f1de4f9532 Additional long-query fixes from Mike Ansley and yours truly. psql.c seems clean of query length restrictions now. Tom Lane 1999-09-06 23:30:53 +00:00
  • d2f7d1f346 Mark bpchareq not hashjoinable, since it strips trailing blanks before comparison; if fields being joined are different widths then hashing will yield wrong answer. Also, remove hashjoinable mark from all uses of array_eq, because array structures may have padding bytes between elements and the pad bytes are of uncertain content. This could be revisited if array code is cleaned up. Modify opr_sanity regress test to complain if array_eq operator is marked hashjoinable. Tom Lane 1999-09-06 21:16:20 +00:00
  • 60c3ccffbe Comment out FileUnlink of excess segments during mdtruncate(). This is unsafe in 6.5 because other backends may be able to access the file before noticing the shared cache inval message that tells 'em to re-open the file. We have fixed this for 6.6 but the changes seem too risky to back-patch for 6.5.2. Also, back-patch Tatsuo's change to prevent creation of files during mdopen(). Tom Lane 1999-09-06 20:00:15 +00:00
  • 22fe3d4b04 I finally understood what sinvaladt.c is doing --- and it offended my aesthestic sensibility that there was so much unreadable code doing so little. Rewritten code is about half the size, faster, and (I hope) much more intelligible. Tom Lane 1999-09-06 19:37:38 +00:00
  • cc8b67a5c3 Fix relcache.c so that local relations (those created during current transaction) are not flushed by shared-cache-inval reset message. SI reset actually works now, for probably the first time in a long time. I was able to run initdb and regression tests with a 16-element SI message array, with a lot of NOTICE: cache state reset messages but no crashes. Tom Lane 1999-09-06 19:33:16 +00:00
  • c5092847e7 RelationCacheInvalidate thought there were 7 nailed-in-cache system tables, but actually there are only 6 --- see RelationInitialize. Kinda makes you wonder how long ago this code was last executed... Tom Lane 1999-09-06 18:13:02 +00:00
  • 7d0a5342a3 test Bruce Momjian 1999-09-06 15:15:07 +00:00
  • b9d01fe288 Per Tatsuo's recommendation, change mdopen so that it won't automatically create the file, except during bootstrap mode where that seems to be necessary. Tom Lane 1999-09-05 23:24:53 +00:00
  • 958e45a84b Backpatch fix for unary operators in rule deparser. Tom Lane 1999-09-05 22:55:28 +00:00
  • 0041202b98 Disallow DROP TABLE/DROP INDEX inside a transaction block. We can't support these properly, since once the relation's physical files are unlinked, there's no way to roll back the transaction. I suppose we could postpone the unlink till transaction commit, but then what of BEGIN; DROP TABLE foo; CREATE TABLE foo; ? The code does allow dropping a table/index created in the current transaction block, however, since the post-abort state would be that the table doesn't exist anyway. Tom Lane 1999-09-05 17:43:47 +00:00
  • 6645a73863 IsTransactionBlock() should return true in TBLOCK_ABORT state. Tom Lane 1999-09-05 17:12:34 +00:00
  • 4fa1eeb826 remove elogs used for debugging. Bruce Momjian 1999-09-04 22:03:09 +00:00
  • 0e14dfe0fb Intercept temp table lookups further up to map temp names. Bruce Momjian 1999-09-04 22:00:30 +00:00
  • cb36c0f682 In RelationNameGetRelation(), replace temp table name by real name before doing lookup. We only want to index temp tables by their real names in the relcache, to ensure there's not more than one relcache entry for them. Tom Lane 1999-09-04 21:47:23 +00:00
  • 15dd167854 Avoid transaction overhead when there are no temp tables to be deleted. Tom Lane 1999-09-04 21:45:48 +00:00
  • a24ebc3f7e Remove no-longer-needed code to update temprel's copy of pg_class tuple during ALTER TABLE ADD COLUMN. Tom Lane 1999-09-04 21:19:33 +00:00
  • fb7548f4db Invalidate temp entries for aborted transactions. Bruce Momjian 1999-09-04 19:55:50 +00:00
  • b4a607c9e0 Modify RelationFlushRelation so that if the relcache entry has positive refcount, it is rebuilt from pg_class data. This ensures that relcache entries will track changes made by other backends. Formerly, a shared inval report would just be ignored if it happened to arrive while the relcache entry was in use. Also, fix relcache to reset ref counts to zero during transaction abort. Finally, change LockRelation() so that it checks for shared inval reports after obtaining the lock. In this way, once any kind of lock has been obtained on a rel, we can trust the relcache entry to be up-to-date. Tom Lane 1999-09-04 18:42:15 +00:00
  • 8add6d71cf Modify sinval so that InvalidateSharedInvalid() does not hold the SInval spinlock while it is calling the passed invalFunction or resetFunction. This is necessary to avoid deadlock with lmgr change; InvalidateSharedInvalid can be called recursively now. It should be a good performance improvement anyway --- holding a spinlock for more than a very short interval is a no-no. Tom Lane 1999-09-04 18:36:45 +00:00
  • ae01c7f5bb Fix for perl5 on BSD/OS breaks most other platforms, so back it out. istm that this would be a job for configure. Most modern OSes actually use perl5 by default ;) Thomas G. Lockhart 1999-09-03 13:46:33 +00:00
  • 283df996c6 driver v06-40-0007 Byron Nikolaidis 1999-09-03 05:29:00 +00:00
  • 19f947e800 driver v06-40-0007 Byron Nikolaidis 1999-09-03 04:41:45 +00:00
  • aa291955a8 I'm gonna stick my neck out a little and back-patch these changes into REL6_5 ... they could use some more testing before we release 6.5.2, though. Tom Lane 1999-09-02 04:07:18 +00:00
  • 51f62ea45c Rule deparser didn't handle unary operators correctly. Tom Lane 1999-09-02 03:04:04 +00:00
  • 68c323483c Repair a bunch of problems in md.c. This builds on Hiroshi's insight that RelationFlushRelation ought to invoke smgrclose, and that the way to make that work is to ensure that mdclose doesn't fail if the relation is already closed (or unlinked, if we are looking at a DROP TABLE). While I was testing that, I was able to identify several problems that we had with multiple-segment relations. The system is now able to do initdb and pass the regression tests with a very small segment size (I had it set to 64Kb per segment for testing). I don't believe that ever worked before. File descriptor leaks seem to be gone too. I have partially addressed the concerns we had about mdtruncate(), too. On a Win32 or NFS filesystem it is not possible to unlink a file that another backend is holding open, so what md.c now does is to truncate unwanted files to zero length before trying to unlink them. The other backends will be forced to close their open files by relation cache invalidation --- but I think it would take considerable work to make that happen before vacuum truncates the relation rather than after. Leaving zero-length files lying around seems a usable compromise. Tom Lane 1999-09-02 02:57:50 +00:00
  • 632b56946b document -x for pg_dump Bruce Momjian 1999-09-01 23:06:26 +00:00
  • 4478d299e1 Document -x properly for pg_dump. Bruce Momjian 1999-09-01 23:05:20 +00:00
  • 4477e0d363 This is to re-use space on index pages freed by vacuum. Marc G. Fournier 1999-09-01 17:54:00 +00:00
  • db5d724986 Fix wording on allowed/forbidden keyword usage. Thanks to Michael Deck <deckm@cleansoft.com> for the tipoff. Add more examples for language components. Thomas G. Lockhart 1999-09-01 02:37:40 +00:00
  • e25e6a6dc3 Commit the bulk of Mike Ansley's long-query changes in the backend. Still much left to do. Tom Lane 1999-08-31 04:26:40 +00:00
  • ab5cafa5d3 Update frontend libpq to remove limits on query lengths, error/notice message lengths, and number of fields per tuple. Add pqexpbuffer.c/.h, a frontend version of backend's stringinfo module. This is first step in applying Mike Ansley's long-query patches, even though he didn't do any of these particular changes... Tom Lane 1999-08-31 01:37:37 +00:00
  • 130e372b5d Minor improvements to stringinfo package to make it more robust, since it's about to get used much more heavily. Tom Lane 1999-08-31 01:28:37 +00:00
  • dad54bf386 Fix quoting problems in mkMakefile.tcldefs.sh.in and mkMakefile.tkdefs.sh.in. Tom Lane 1999-08-29 20:11:52 +00:00
  • f4add18557 Fix quoting problems in mkMakefile.tcldefs.sh.in and mkMakefile.tkdefs.sh.in. Tom Lane 1999-08-29 20:09:44 +00:00
  • 4c93b04f48 Backpatch rule deparsing bugfixes into 6.5.*. I believe this is a pretty critical bugfix, since without it, stored rules containing CASE expressions or array references cannot be dumped by pg_dump. Worse, rules containing expressions like (a + b) * c will be dumped incorrectly (minus the parentheses, silently yielding the wrong answer...). Tom Lane 1999-08-29 19:22:28 +00:00
  • 04ffd2bc0a Back-patch fix for timestamp(datetime) into 6.5.*. I believe this is not a violation of our policy against requiring initdb for minor-version bugfixes, since users don't *have* to initdb; they just won't see any effect from the fix if they don't. But a user who does do a clean install or initdb upgrade to 6.5.2 will get the fix, and that seems worthwhile. Tom Lane 1999-08-29 01:39:57 +00:00
  • 1f14a9de74 Correct broken entries for pg_proc OIDs 1364 (time(abstime)) and 1370 (timestamp(datetime)). This does not force an initdb, exactly, but you won't see the effects of the bug fix until you do one. BTW, OID 1358 for timespan(time) is still broken: select timespan('21:11:26'::time); ERROR: No such function 'time_timespan' with the specified attributes But I couldn't figure out what it ought to be defined as, so I left it be. Tom Lane 1999-08-29 01:35:11 +00:00
  • 9202c4f798 Update rules test expected output to conform to slightly more verbose results from ruleutils.c changes. Tom Lane 1999-08-28 04:00:41 +00:00
  • 958600156c Fix several problems in rule deparsing: didn't handle array references or CASE expressions, didn't parenthesize complex expressions properly. Also, always output variable references as fully qualified names to eliminate ambiguity bug recently reported. (This could be smarter, but reliability comes first.) Tom Lane 1999-08-28 03:59:05 +00:00
  • 37d20eb855 Clean up some mistakes in handling of uplevel Vars in planner. Most parts of the planner should ignore, or indeed never even see, uplevel Vars because they will be or have been replaced by Params. There were a couple of places that got it wrong though, probably my fault from recent changes... Tom Lane 1999-08-26 05:09:06 +00:00
  • 5adebf83b6 Clean up some bugs in oper_select_candidate(), notably the last loop which would return the *first* surviving-to-that-point candidate regardless of which one actually passed the test. This was producing such curious results as 'oid % 2' getting translated to 'int2(oid) % 2'. Tom Lane 1999-08-26 04:59:15 +00:00
  • 42af56e1ea Revise implementation of SubLinks so that there is a consistent, documented intepretation of the lefthand and oper fields. Fix a number of obscure problems while at it --- for example, the old code failed if the parser decided to insert a type-coercion function just below the operator of a SubLink. CAUTION: this will break stored rules that contain subplans. You may need to initdb. Tom Lane 1999-08-25 23:21:43 +00:00
  • edda70c0de Fix vacuum's memory consumption Tatsuo Ishii 1999-08-25 12:20:57 +00:00
  • 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. Tatsuo Ishii 1999-08-25 12:18:31 +00:00
  • b9d202fb0e Sorry, I accidentaly reverted to 6.5.1 vacuum.c. Now everything should be ok. Tatsuo Ishii 1999-08-25 12:01:45 +00:00
  • 366f6ce255 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. Tatsuo Ishii 1999-08-25 11:32:52 +00:00
  • f134d1fb2c Fix vacuum's memory consumption Tatsuo Ishii 1999-08-25 11:27:06 +00:00
  • 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? Tom Lane 1999-08-24 20:11:19 +00:00
  • 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... Tom Lane 1999-08-24 00:09:56 +00:00
  • 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. Tom Lane 1999-08-23 23:48:39 +00:00
  • e8140adb10 Further sort-order twiddling in optimizer: be smart about case where ORDER BY and GROUP BY request the same sort order. Tom Lane 1999-08-22 23:56:45 +00:00
  • c9d040d85e Un-break code generated by ECPGRelease production. Tom Lane 1999-08-22 20:37:24 +00:00
  • 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 ... Tom Lane 1999-08-22 20:15:04 +00:00
  • 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... Tom Lane 1999-08-21 03:49:17 +00:00
  • 0818dfa4f0 Back-patch int8 fixes into REL6_5. Tom Lane 1999-08-21 03:09:18 +00:00
  • 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). Tom Lane 1999-08-21 03:06:58 +00:00
  • d91baea025 Ooops ... I had left some test coding in selfuncs.c that failed on 'field < textconstant' ... Tom Lane 1999-08-21 00:56:18 +00:00
  • ca5c10f778 Update TODO list. Bruce Momjian 1999-08-18 15:11:52 +00:00
  • 02efaa14e5 Old multi-byte bug. Forgot to rename #ifdef MB to #ifdef MULTIBYTE Now SET NAMES working again... Tatsuo Ishii 1999-08-18 13:04:45 +00:00
  • b4c911f508 Old multi-byte bug. Forgot to rename #ifdef MB to #ifdef MULTIBYTE Now SET NAMES working again... Tatsuo Ishii 1999-08-18 13:01:50 +00:00
  • 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... Tom Lane 1999-08-18 04:15:16 +00:00
  • 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. Tom Lane 1999-08-17 21:21:22 +00:00
  • 898b21267d Add missing docs semicolon. Bruce Momjian 1999-08-17 17:31:11 +00:00
  • ed3f69168f EXPLAIN didn't know about 'Materialize' plan nodes. Tom Lane 1999-08-16 23:47:23 +00:00
  • 91f82de48a Assign sort keys properly when there are duplicate entries in pathkey list --- corrects misbehavior seen with multiple mergejoin clauses mentioning same variable. Tom Lane 1999-08-16 23:07:20 +00:00
  • 738e635f94 Typo fix. Bruce Momjian 1999-08-16 20:32:56 +00:00
  • 55179388f9 Typo fix Bruce Momjian 1999-08-16 20:32:34 +00:00
  • 4978853b55 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. Bruce Momjian 1999-08-16 20:29:11 +00:00
  • 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. Bruce Momjian 1999-08-16 20:27:19 +00:00
  • c5d0a1bc42 Fix for perl5 on BSD/OS. Bruce Momjian 1999-08-16 20:12:12 +00:00
  • 49df345016 Fix for perl5 on BSD/OS. Bruce Momjian 1999-08-16 20:10:25 +00:00
  • aa2cc6ebbe Change >& to > and 2>&1. Bruce Momjian 1999-08-16 19:59:25 +00:00
  • e69a997d02 Allow BSD yacc and bison to compile pl code. Bruce Momjian 1999-08-16 19:57:21 +00:00
  • bad0422cbc Allow BSD yacc and bison to compile pl code. Bruce Momjian 1999-08-16 19:55:46 +00:00
  • 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. Tom Lane 1999-08-16 02:17:58 +00:00
  • 08320bfb22 Small updates to #include lists for pending optimizer checkin. Tom Lane 1999-08-16 02:10:13 +00:00
  • c9b128fcdb Move funcid_get_rettype() to lsyscache. Tom Lane 1999-08-16 02:08:59 +00:00
  • b1baf1ff60 Add get_func_rettype() to general-use lsyscache routines, since it's now needed in both optimizer and parser. Tom Lane 1999-08-16 02:06:25 +00:00
  • bab13a70ff Fix for Win32 making problem with MB enabled. Patches created by Hiroki Kataoka. Tatsuo Ishii 1999-08-16 02:04:05 +00:00
  • d95acd0668 Fix for Win32 making problem with MB enabled. Patches created by Hiroki Kataoka. Tatsuo Ishii 1999-08-16 02:01:53 +00:00
  • 8a98690066 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. Thomas G. Lockhart 1999-08-15 06:50:22 +00:00
  • 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. Thomas G. Lockhart 1999-08-15 06:46:49 +00:00
  • 288373f5a4 LispUnion fix changes output ordering for inheritance tests. Tom Lane 1999-08-14 19:30:21 +00:00
  • 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. Tom Lane 1999-08-14 19:29:35 +00:00
  • 448d1ab0ad Update TODO list. Bruce Momjian 1999-08-13 16:56:04 +00:00
  • 47f18ec702 Update comments about pathkeys. Tom Lane 1999-08-13 01:17:16 +00:00
  • 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. Tom Lane 1999-08-12 04:32:54 +00:00
  • 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... Tom Lane 1999-08-12 00:42:43 +00:00
  • 6075717df0 Update TODO list. Bruce Momjian 1999-08-10 16:56:54 +00:00
  • 2ae51c86c9 Minor cleanups and code beautification; eliminate some routines that are now dead code. Tom Lane 1999-08-10 03:00:15 +00:00
  • 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. Tom Lane 1999-08-10 02:58:56 +00:00
  • 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 Bruce Momjian 1999-08-09 06:20:27 +00:00
  • 5efe31214a Clean up tlist.c tree-walking routines with expression_tree_mutator. Tom Lane 1999-08-09 05:34:13 +00:00
  • 14f84cd821 Store -1 in attdisbursion to signal 'no duplicates in column'. Centralize att_disbursion readout logic. Tom Lane 1999-08-09 03:16:47 +00:00
  • 5af4b04f31 Move get_attdisbursion to lsyscache. Clean up get_typdefault. Tom Lane 1999-08-09 03:13:31 +00:00
  • e9054829a2 Update comments about attdisbursion. NO code change. Tom Lane 1999-08-09 02:45:56 +00:00
  • 1ecb43a40c Re-use free space on index pages with duplicates. Vadim B. Mikheev 1999-08-09 01:39:19 +00:00
  • 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... Tom Lane 1999-08-09 01:01:42 +00:00