1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-09 22:41:56 +03:00
Commit Graph

839 Commits

Author SHA1 Message Date
9e7e29e6c9 First cut at doing LIKE/regex indexing optimization in
optimizer rather than parser.  This has many advantages, such as not
getting fooled by chance uses of operator names ~ and ~~ (the operators
are identified by OID now), and not creating useless comparison operations
in contexts where the comparisons will not actually be used as indexquals.
The new code also recognizes exact-match LIKE and regex patterns, and
produces an = indexqual instead of >= and <=.

This change does NOT fix the problem with non-ASCII locales: the code
still doesn't know how to generate an upper bound indexqual for non-ASCII
collation order.  But it's no worse than before, just the same deficiency
in a different place...

Also, dike out loc_restrictinfo fields in Plan nodes.  These were doing
nothing useful in the absence of 'expensive functions' optimization,
and they took a considerable amount of processing to fill in.
1999-07-27 03:51:11 +00:00
8ae29a1d40 Remove 'restrictinfojoinid' field from RestrictInfo nodes.
The only place it was being used was as temporary storage in indxpath.c,
and the logic was wrong: the same restrictinfo node could get chosen to
carry the info for two different joins.  Right fix is to return a second
list of unjoined-relids parallel to the list of clause groups.
1999-07-25 17:53:27 +00:00
ac4913a0dd Clean up messy clause-selectivity code in clausesel.c; repair bug
identified by Hiroshi (incorrect cost attributed to OR clauses
after multiple passes through set_rest_selec()).  I think the code
was trying to allow selectivities of OR subclauses to be passed in
from outside, but noplace was actually passing any useful data, and
set_rest_selec() was passing wrong data.

Restructure representation of "indexqual" in IndexPath nodes so that
it is the same as for indxqual in completed IndexScan nodes: namely,
a toplevel list with an entry for each pass of the index scan, having
sublists that are implicitly-ANDed index qual conditions for that pass.
You don't want to know what the old representation was :-(

Improve documentation of OR-clause indexscan functions.

Remove useless 'notclause' field from RestrictInfo nodes.  (This might
force an initdb for anyone who has stored rules containing RestrictInfos,
but I do not think that RestrictInfo ever appears in completed plans.)
1999-07-24 23:21:14 +00:00
3406901a29 Move some system includes into c.h, and remove duplicates. 1999-07-17 20:18:55 +00:00
a71802e12e Final cleanup. 1999-07-16 05:00:38 +00:00
2e6b1e63a3 Remove unused #includes in *.c files. 1999-07-15 22:40:16 +00:00
4b2c2850bf Clean up #include in /include directory. Add scripts for checking includes. 1999-07-15 15:21:54 +00:00
fcff1cdf4e Another pgindent run. Sorry folks. 1999-05-25 22:43:53 +00:00
07842084fe pgindent run over code. 1999-05-25 16:15:34 +00:00
353d36f979 Remove no-longer-used fields in Hash and HashJoin nodes. 1999-05-18 21:34:29 +00:00
79c2576f77 Replaced targetlist entry in GroupClause by reference number
in Resdom and GroupClause so changing of resno's doesn't confuse
the grouping any more.

Jan
1999-05-12 15:02:39 +00:00
6e702210c2 Fix for _copyUnique() suggested by Hiroshi Inoue 1999-04-27 09:49:36 +00:00
4438b70b94 Repair some problems in planner's handling of HAVING clauses.
This fixes a few of the problems Hiroshi Inoue complained of, but
I have not touched the rewrite-related issues.
1999-04-19 01:43:12 +00:00
e0345e09bf Partial fix for copied-plan bugs reported by Hiroshi Inoue:
_copyResult didn't copy subPlan structure completely.  _copyAgg is still
busted, apparently because of changes from EXCEPT/INTERSECT patch
(get_agg_tlist_references is no longer sufficient to find all aggregates).
No time to look at that tonight, however.
1999-03-03 00:02:42 +00:00
b204d10c79 Executor no longer cares about mergejoinop, mergerightorder, mergeleftorder,
so remove them from MergeJoin node.  Hack together a partial
solution for commuted mergejoin operators --- yesterday
a mergejoin int4 = int8 would crash if the planner decided to
commute it, today it works.  The planner's representation of
mergejoins really needs a rewrite though.
Also, further testing of mergejoin ops in opr_sanity regress test.
1999-03-01 00:10:44 +00:00
1e70c1fe5d comments cleanup. 1999-02-22 19:55:44 +00:00
31cce21fb0 Fix bushy plans. Cleanup. 1999-02-18 00:49:48 +00:00
c5449d5354 otherrels is now unjoined_rels 1999-02-15 05:21:12 +00:00
ba2883b264 Remove duplicate geqo functions, and more optimizer cleanup 1999-02-15 03:22:37 +00:00
6724a50787 Change my-function-name-- to my_function_name, and optimizer renames. 1999-02-13 23:22:53 +00:00
c0d17c7aee JoinPath -> NestPath for nested loop. 1999-02-12 06:43:53 +00:00
3fdb9bb9c7 Fix optimizer and make faster. 1999-02-12 05:57:08 +00:00
d244df95db More optimizer speedups. 1999-02-11 14:59:09 +00:00
f859c81c18 Rename Path.keys to Path.pathkeys. Too many 'keys' used for other things. 1999-02-10 03:52:54 +00:00
318e593f03 Rename Temp to Noname for noname tables. 1999-02-09 17:03:14 +00:00
fe35ffe7e0 Major optimizer improvement for joining a large number of tables. 1999-02-09 03:51:42 +00:00
54e5d25666 Optimizer cleanup. 1999-02-08 04:29:25 +00:00
6e2edaf4b8 Optimizer cleanup. 1999-02-05 19:59:31 +00:00
ce3afccf7f More optimizer cleanups. 1999-02-04 03:19:11 +00:00
18fbe4142f More optimizer renaming HInfo -> HashInfo. 1999-02-04 01:47:02 +00:00
9322950aa4 Cleanup of source files where 'return' or 'var =' is alone on a line. 1999-02-03 21:18:02 +00:00
8d9237d485 Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README. 1999-02-03 20:15:53 +00:00
4390b0bfbe Add TEMP tables/indexes. Add COPY pfree(). Other cleanups. 1999-02-02 03:45:56 +00:00
e3a1ab764e READ COMMITTED isolevel is implemented and is default now. 1999-01-29 09:23:17 +00:00
1401f63dd1 Agg/Aggreg cleanup and datetime.sql patch. 1999-01-25 18:02:28 +00:00
17467bb7fb Rename Aggreg to Aggref. 1999-01-24 00:28:37 +00:00
03155dc764 It seems that SPI_prepare() doesn't work well in some cases.
Pawel Pierscionek [pawel@astercity.net] reported about the
following case 1([SQL] drop table in pgsql).
Michael Contzen [mcontzen@dohle.com] reported about the
following case 2(PL/PGSQL bug using aggregates).
You can find it from pgsql-hackers archive.

1. PL/pgSQL can't execute UTILITY commands.
   SPI_prepare() doesn't copy(save) the utilityStmt member of
   Query type nodes,because copyObject() is not implemented
   for nodes of (Create/Destroy etc)Stmt type.

2. Aggregates in PL/pgSQL cause wrong results.

...
   It's a list including Aggreg type nodes which exist in
   TargetList(i.e Aggreg type nodes are common to aggs
   member list and TargetList).
   AFAIC the common pointer is not copied to the same
   pointer by copyObject() function.
   In my patch I reconstruct aggs member node from
   new(copied) Agg type node.
   Is it proper to use set_agg_tlist_references() function to
   reconstruct aggs member node for Agg type nodes ?

Thanks.

Hiroshi Inoue
Inoue@tpf.co.jp
1999-01-21 22:55:41 +00:00
1f37905681 Copy RowMark node (it's for (-:)) FOR UPDATE). 1999-01-21 16:38:36 +00:00
bedd04a551 Implement CASE expression. 1998-12-04 15:34:49 +00:00
34680930d5 Fix using indices in OR.
EXPLAIN all indices used.
1998-11-22 10:48:45 +00:00
002657f7ed Add LIMIT syntax for Jan. 1998-10-22 13:52:24 +00:00
fa1a8d6a97 OK, folks, here is the pgindent output. 1998-09-01 04:40:42 +00:00
af74855a60 Renaming cleanup, no pgindent yet. 1998-09-01 03:29:17 +00:00
d9be0ff432 MergeSort was sometimes called mergejoin and was confusing. Now
it is now only mergejoin.
1998-08-04 16:44:31 +00:00
0a2e5cdfc9 Allow index use with OR clauses. 1998-08-01 22:12:13 +00:00
584f9438ca Rename Rel to RelOptInfo. 1998-07-18 04:22:52 +00:00
9e964f90fb Fix explain for union and inheritance. Rename Append structure
members to be clearer.  Fix cost computation for these.
1998-07-15 14:54:39 +00:00
6bd323c6b3 Remove un-needed braces around single statements. 1998-06-15 19:30:31 +00:00
a32450a585 pgindent run before 6.3 release, with Thomas' requested changes. 1998-02-26 04:46:47 +00:00
e4fd534645 Partial fix for select distinct in subselect. 1998-02-23 02:54:11 +00:00