Commit Graph

933 Commits

Author SHA1 Message Date
3fdb9bb9c7 Fix optimizer and make faster. 1999-02-12 05:57:08 +00:00
6de25f09b1 Optimizer cleanup. 1999-02-11 17:00:49 +00:00
d244df95db More optimizer speedups. 1999-02-11 14:59:09 +00:00
dbd80c97f4 Optimizer fix for samekeys() and cost fixes for longer optimizer keys. 1999-02-11 04:08:44 +00:00
403b3eff79 Include <varargs.h> on SunOS. (Does any other platform need it??) 1999-02-11 01:36:55 +00:00
9dbb0efb0b Optmizer cleanup 1999-02-10 21:02:50 +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
be948af2e8 Added LIMIT/OFFSET functionality including new regression test for it.
Removed CURRENT keyword for rule queries and changed rules regression
accordingly. CURRENT has beed announced to disappear in v6.5.

Jan
1999-02-08 14:14:32 +00:00
54e5d25666 Optimizer cleanup. 1999-02-08 04:29:25 +00:00
5212ef8e46 Correct definition of srandom() --- it takes unsigned int not int. 1999-02-07 22:04:57 +00:00
ef590e101e Changed ExecConstraints() and ExecRelCheck() to cache the constraints
qualification expression trees in the execution state. Prevents from
memory exhaustion on INSERT, UPDATE or COPY to tables that have CHECK
constraints. Speedup against the variant using freeObject() is more than
factor 2.

Jan
1999-02-07 16:17:14 +00:00
a553760845 Optimizer cleanup. 1999-02-06 17:29:30 +00:00
ead64f317b New alloc set code using a memory block pool for small allocations.
Jan
1999-02-06 16:50:34 +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
8d9237d485 Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README. 1999-02-03 20:15:53 +00:00
4090d17fee SET_ARGS cleanup 1999-02-02 23:53:26 +00:00
a7ad43cd18 Included patches make some enhancements to the multi-byte support.
o allow to use Big5 (a Chinese encoding used in Taiwan) as a client
  encoding. In this case the server side encoding should be EUC_TW

o add EUC_TW and Big5 test cases to the regression and the mb test
  (contributed by Jonah Kuo)

o fix mistake in include/mb/pg_wchar.h. An encoding id for EUC_TW was
  not correct (was 3 and now is 4)

o update documents (doc/README.mb and README.mb.jp)

o update psql helpfile (bin/psql/psqlHelp.h)

--
Tatsuo Ishii
t-ishii@sra.co.jp
1999-02-02 18:51:40 +00:00
8e958b8a38 Fix create_rule is->as. 1999-02-02 17:46:17 +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
28d8b42ca5 Speedup of PL/pgSQL by calling ExecEvalExpr() directly
instead of SPI_execp() for simple expressions.

Jan
1999-01-27 16:15:22 +00:00
422221c90d Another SELECT speedup: extract OIDs of column print functions
only once per SELECT, not once per tuple.  10% here, 10% there,
pretty soon you're talking about real speedups ...
1999-01-27 00:36:28 +00:00
1401f63dd1 Agg/Aggreg cleanup and datetime.sql patch. 1999-01-25 18:02:28 +00:00
247b3f9054 SELECT FOR UPDATE is implemented... 1999-01-25 12:01:19 +00:00
d03e98737c Replace typtoout() and gettypelem() with a single routine,
so that fetching an attribute value needs only one SearchSysCacheTuple call
instead of two redundant searches.  This speeds up a large SELECT by about
ten percent, and probably will help GROUP BY and SELECT DISTINCT too.
1999-01-24 05:40:49 +00:00
77f5428244 Fix a couple little problems with signed vs. unsigned
characters ...
1999-01-24 02:47:15 +00:00
17467bb7fb Rename Aggreg to Aggref. 1999-01-24 00:28:37 +00:00
598a4e15dd Remove unused Choose node. 1999-01-23 23:28:09 +00:00
e6725d1574 Add explicit buffering in backend libpq, to compensate for
buffering lost by not going through stdio anymore for client I/O.
1999-01-23 22:27:29 +00:00
c91dbcc5c7 The following patch finishes primary key support. Previously, when
a field was labelled as a primary key, the system automatically
created a unique index on the field.  This patch extends it so
that the index has the indisprimary field set.  You can pull a list
of primary keys with the followiing select.

SELECT pg_class.relname, pg_attribute.attname
    FROM pg_class, pg_attribute, pg_index
    WHERE pg_class.oid = pg_attribute.attrelid AND
        pg_class.oid = pg_index.indrelid AND
        pg_index.indkey[0] = pg_attribute.attnum AND
        pg_index.indisunique = 't';

There is nothing in this patch that modifies the template database to
set the indisprimary attribute for system tables.  Should they be
changed or should we only be concerned with user tables?

D'Arcy
1999-01-21 22:48:20 +00:00
12be3e08f1 FOR UPDATE is in parser & rules. 1999-01-21 16:08:55 +00:00
791822e3a7 Clean up leap year support and date/time validation.
Move declarations to allow sharing between modules.
1999-01-20 16:26:45 +00:00
909c519733 Add missing Windows files. 1999-01-18 12:43:55 +00:00
bd8ffc6f3f Hi!
INTERSECT and EXCEPT is available for postgresql-v6.4!

The patch against v6.4 is included at the end of the current text
(in uuencoded form!)

I also included the text of my Master's Thesis. (a postscript
version). I hope that you find something of it useful and would be
happy if parts of it find their way into the PostgreSQL documentation
project (If so, tell me, then I send the sources of the document!)

The contents of the document are:
  -) The first chapter might be of less interest as it gives only an
     overview on SQL.

  -) The second chapter gives a description on much of PostgreSQL's
     features (like user defined types etc. and how to use these features)

  -) The third chapter starts with an overview of PostgreSQL's internal
     structure with focus on the stages a query has to pass (i.e. parser,
     planner/optimizer, executor). Then a detailed description of the
     implementation of the Having clause and the Intersect/Except logic is
     given.

Originally I worked on v6.3.2 but never found time enough to prepare
and post a patch. Now I applied the changes to v6.4 to get Intersect
and Except working with the new version. Chapter 3 of my documentation
deals with the changes against v6.3.2, so keep that in mind when
comparing the parts of the code printed there with the patched sources
of v6.4.

Here are some remarks on the patch. There are some things that have
still to be done but at the moment I don't have time to do them
myself. (I'm doing my military service at the moment) Sorry for that
:-(

-) I used a rewrite technique for the implementation of the Except/Intersect
   logic which rewrites the query to a semantically equivalent query before
   it is handed to the rewrite system (for views, rules etc.), planner,
   executor etc.

-) In v6.3.2 the types of the attributes of two select statements
   connected by the UNION keyword had to match 100%. In v6.4 the types
   only need to be familiar (i.e. int and float can be mixed). Since this
   feature did not exist when I worked on Intersect/Except it
   does not work correctly for Except/Intersect queries WHEN USED IN
   COMBINATION WITH UNIONS! (i.e. sometimes the wrong type is used for the
   resulting table. This is because until now the types of the attributes of
   the first select statement have been used for the resulting table.
   When Intersects and/or Excepts are used in combination with Unions it
   might happen, that the first select statement of the original query
   appears at another position in the query which will be executed. The reason
   for this is the technique used for the implementation of
   Except/Intersect which does a query rewrite!)
   NOTE: It is NOT broken for pure UNION queries and pure INTERSECT/EXCEPT
         queries!!!

-) I had to add the field intersect_clause to some data structures
   but did not find time to implement printfuncs for the new field.
   This does NOT break the debug modes but when an Except/Intersect
   is used the query debug output will be the already rewritten query.

-) Massive changes to the grammar rules for SELECT and INSERT statements
   have been necessary (see comments in gram.y and documentation for
   deatails) in order to be able to use mixed queries like
   (SELECT ... UNION (SELECT ... EXCEPT SELECT)) INTERSECT SELECT...;

-) When using UNION/EXCEPT/INTERSECT you will get:
   NOTICE: equal: "Don't know if nodes of type xxx are equal".
   I did not have  time to add comparsion support for all the needed nodes,
   but the default behaviour of the function equal met my requirements.
   I did not dare to supress this message!

   That's the reason why the regression test for union will fail: These
   messages are also included in the union.out file!

-) Somebody of you changed the union_planner() function for v6.4
   (I copied the targetlist to new_tlist and that was removed and
   replaced by a cleanup of the original targetlist). These chnages
   violated some having queries executed against views so I changed
   it back again. I did not have time to examine the differences between the
   two versions but now it works :-)
   If you want to find out, try the file queries/view_having.sql on
   both versions and compare the results . Two queries won't produce a
   correct result with your version.

regards

    Stefan
1999-01-18 00:10:17 +00:00
00a420d53c Add description of ELOG_TIMESTAMPS and USE_SYSLOG options,
per Massimo Dal Zotto.
1999-01-17 20:58:03 +00:00
7a6b562fdf Apply Win32 patch from Horak Daniel. 1999-01-17 06:20:06 +00:00
7fab608205 Add configure test to see whether vsnprintf() is present,
separately from snprintf() --- HPUX, for one, has snprintf but not
vsnprintf.  Fix a minor typo in snprintf.c, too.
1999-01-17 03:22:52 +00:00
21badba151 Replace direct inclusions of c.h with inclusion of postgres.h,
to ensure that config.h is included as well.
1999-01-17 03:04:57 +00:00
4e34686a36 Apply Magnus Hagander's followup patch to correct
out-of-sync routine prototypes ... the system doesn't compile without this ...
1999-01-17 01:45:42 +00:00
d8b96ade81 From: Magnus Hagander <mha@sollentuna.net>
Here's another patch for the libpq backend areas. This patch removes all
usage of "FILE *" on the communications channel. It also cleans up the
comments and headers in the pqcomm.c file - a lot of things were either
missing or incorrect. Finally, it removes a couple of unused functions
(leftovers from the time of shared code between the libpq backend and
frontend).
1999-01-12 12:49:52 +00:00
3b3ffc8d97 From: Magnus Hagander <mha@sollentuna.net>
Here is a first patch to cleanup the backend side of libpq.
This patch removes all external dependencies on the "Pfin" and "Pfout" that
are declared in pqcomm.h. These variables are also changed to "static" to
make sure.
Almost all the change is in the handler of the "copy" command - most other
areas of the backend already used the correct functions.
This change will make the way for cleanup of the internal stuff there - now
that all the functions accessing the file descriptors are confined to a
single directory.
1999-01-11 03:56:11 +00:00
dfa23f5e41 SELECT FOR UPDATE syntax 1999-01-05 15:46:25 +00:00
b5626a2089 Restricted maximum precision for NUMERIC to 1000 digits.
Anything else is CPU overkill.

Jan
1999-01-05 11:12:11 +00:00
da361ee24b Add max oid display, rather than returning just a dash for the last entry. 1998-12-31 20:09:49 +00:00
5df20d4449 Little precision fix for POWER(). I discovered problems with big
exponents.

Jan
1998-12-30 20:46:06 +00:00
0e9d75c6ac Added NUMERIC data type with many builtin funcitons, operators
and aggregates.

Jan
1998-12-30 19:56:35 +00:00