]> granicus.if.org Git - postgresql/blob - doc/TODO
Add description and item:
[postgresql] / doc / TODO
1
2 PostgreSQL TODO List
3 ====================
4 Current maintainer:     Bruce Momjian (pgman@candle.pha.pa.us)
5 Last updated:           Fri Aug 26 15:41:03 EDT 2005
6
7 The most recent version of this document can be viewed at
8 http://www.postgresql.org/docs/faqs.TODO.html.
9
10 #A hyphen, "-", marks changes that will appear in the upcoming 8.1 release.#
11 #A percent sign, "%", marks items that are easier to implement.#
12
13 Bracketed items, "[]", have more detail.
14
15 This list contains all known PostgreSQL bugs and feature requests. If
16 you would like to work on an item, please read the Developer's FAQ
17 first.
18
19
20 Administration
21 ==============
22
23 * %Remove behavior of postmaster -o after making postmaster/postgres
24   flags unique
25 * %Allow pooled connections to list all prepared queries
26
27   This would allow an application inheriting a pooled connection to know
28   the queries prepared in the current session.
29
30 * Allow major upgrades without dump/reload, perhaps using pg_upgrade 
31   [pg_upgrade]
32 * Check for unreferenced table files created by transactions that were
33   in-progress when the server terminated abruptly
34 * Allow administrators to safely terminate individual sessions either
35   via an SQL function or SIGTERM 
36
37   Lock table corruption following SIGTERM of an individual backend
38   has been reported in 8.0.  A possible cause was fixed in 8.1, but
39   it is unknown whether other problems exist.  This item mostly
40   requires additional testing rather than of writing any new code.
41
42 * %Set proper permissions on non-system schemas during db creation
43
44   Currently all schemas are owned by the super-user because they are
45   copied from the template1 database.
46
47 * Support table partitioning that allows a single table to be stored
48   in subtables that are partitioned based on the primary key or a WHERE
49   clause
50
51
52 * Improve replication solutions
53
54         o Load balancing
55
56           You can use any of the master/slave replication servers to use a
57           standby server for data warehousing. To allow read/write queries to
58           multiple servers, you need multi-master replication like pgcluster.
59
60         o Allow replication over unreliable or non-persistent links
61
62
63 * Configuration files
64
65         o %Add "include file" functionality in postgresql.conf
66         o %Allow commenting of variables in postgresql.conf to restore them
67           to defaults
68
69           Currently, if a variable is commented out, it keeps the
70           previous uncommented value until a server restarted.
71
72         o %Allow pg_hba.conf settings to be controlled via SQL
73
74           This would add a function to load the SQL table from
75           pg_hba.conf, and one to writes its contents to the flat file.
76           The table should have a line number that is a float so rows
77           can be inserted between existing rows, e.g. row 2.5 goes
78           between row 2 and row 3.
79
80         o %Allow postgresql.conf file values to be changed via an SQL
81           API, perhaps using SET GLOBAL
82         o Allow the server to be stopped/restarted via an SQL API
83
84
85 * Tablespaces
86
87         * Allow a database in tablespace t1 with tables created in
88           tablespace t2 to be used as a template for a new database created
89           with default tablespace t2
90
91           All objects in the default database tablespace must have default
92           tablespace specifications. This is because new databases are
93           created by copying directories. If you mix default tablespace
94           tables and tablespace-specified tables in the same directory,
95           creating a new database from such a mixed directory would create a
96           new database with tables that had incorrect explicit tablespaces.
97           To fix this would require modifying pg_class in the newly copied
98           database, which we don't currently do.
99
100         * Allow reporting of which objects are in which tablespaces
101
102           This item is difficult because a tablespace can contain objects
103           from multiple databases. There is a server-side function that
104           returns the databases which use a specific tablespace, so this
105           requires a tool that will call that function and connect to each
106           database to find the objects in each database for that tablespace.
107
108         o %Add a GUC variable to control the tablespace for temporary objects
109           and sort files
110
111           It could start with a random tablespace from a supplied list and
112           cycle through the list.
113
114         o Allow WAL replay of CREATE TABLESPACE to work when the directory
115           structure on the recovery computer is different from the original
116
117         o Allow per-tablespace quotas
118
119
120 * Point-In-Time Recovery (PITR)
121
122           o Allow point-in-time recovery to archive partially filled
123             write-ahead logs [pitr]
124
125             Currently only full WAL files are archived. This means that the
126             most recent transactions aren't available for recovery in case
127             of a disk failure. This could be triggered by a user command or
128             a timer.
129
130           o Automatically force archiving of partially-filled WAL files when
131             pg_stop_backup() is called or the server is stopped
132
133             Doing this will allow administrators to know more easily when
134             the archive contins all the files needed for point-in-time
135             recovery.
136
137           o %Create dump tool for write-ahead logs for use in determining
138             transaction id for point-in-time recovery
139           o Allow a warm standby system to also allow read-only queries
140             [pitr]
141
142             This is useful for checking PITR recovery.
143
144           o Allow the PITR process to be debugged and data examined
145
146
147 Monitoring
148 ==========
149
150 * Allow server log information to be output as INSERT statements
151
152   This would allow server log information to be easily loaded into
153   a database for analysis.
154
155 * %Add ability to monitor the use of temporary sort files
156 * Allow server logs to be remotely read and removed using SQL commands
157
158
159 Data Types
160 ==========
161
162 * Improve the MONEY data type
163
164   Change the MONEY data type to use DECIMAL internally, with special
165   locale-aware output formatting.
166
167 * Change NUMERIC to enforce the maximum precision, and increase it
168 * Add NUMERIC division operator that doesn't round?
169
170   Currently NUMERIC _rounds_ the result to the specified precision.  
171   This means division can return a result that multiplied by the 
172   divisor is greater than the dividend, e.g. this returns a value > 10:
173
174     SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
175
176   The positive modulus result returned by NUMERICs might be considered
177   inaccurate, in one sense.
178
179 * Have sequence dependency track use of DEFAULT sequences,
180   seqname.nextval?
181 * %Disallow changing default expression of a SERIAL column?
182 * Fix data types where equality comparison isn't intuitive, e.g. box
183 * %Prevent INET cast to CIDR if the unmasked bits are not zero, or
184   zero the bits
185 * %Prevent INET cast to CIDR from droping netmask, SELECT '1.1.1.1'::inet::cidr
186 * Allow INET + INT4 to increment the host part of the address, or
187   throw an error on overflow
188 * %Add 'tid != tid ' operator for use in corruption recovery
189
190
191 * Dates and Times
192
193         o Allow infinite dates just like infinite timestamps
194         o Add a GUC variable to allow output of interval values in ISO8601 
195           format
196         o Merge hardwired timezone names with the TZ database; allow either 
197           kind everywhere a TZ name is currently taken
198         o Allow customization of the known set of TZ names (generalize the
199           present australian_timezones hack)
200         o Allow TIMESTAMP WITH TIME ZONE to store the original timezone
201           information, either zone name or offset from UTC [timezone]
202
203           If the TIMESTAMP value is stored with a time zone name, interval 
204           computations should adjust based on the time zone rules.
205
206         o Add ISO INTERVAL handling
207                 o Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO 
208                   SECOND
209                 o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
210                 o For syntax that isn't uniquely ISO or PG syntax, like '1:30' or
211                   '1', treat as ISO if there is a range specification clause,
212                   and as PG if there no clause is present, e.g. interpret 
213                           '1:30' MINUTE TO SECOND as '1 minute 30 seconds', and 
214                           interpret '1:30' as '1 hour, 30 minutes'
215                 o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
216                   INTERVAL MONTH), and this should return '12 months'
217                 o Round or truncate values to the requested precision, e.g.
218                   INTERVAL '11 months' AS YEAR should return one or zero
219                 o Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
220
221
222 * Arrays
223
224         o Allow NULLs in arrays
225         o Delay resolution of array expression's data type so assignment
226           coercion can be performed on empty array expressions
227
228
229 * Binary Data
230
231         o Improve vacuum of large objects, like /contrib/vacuumlo?
232         o Add security checking for large objects
233         o Auto-delete large objects when referencing row is deleted
234
235           /contrib/lo offers this functionality.
236
237         o Allow read/write into TOAST values like large objects
238
239           This requires the TOAST column to be stored EXTERNAL.
240
241
242 Functions
243 =========
244
245 * Allow INET subnet tests using non-constants to be indexed
246 * Add transaction_timestamp(), statement_timestamp(), clock_timestamp()
247   functionality
248
249   Current CURRENT_TIMESTAMP returns the start time of the current
250   transaction, and gettimeofday() returns the wallclock time. This will
251   make time reporting more consistent and will allow reporting of
252   the statement start time.
253
254 * %Add pg_get_acldef(), pg_get_typedefault(), and pg_get_attrdef()
255 * Allow to_char() to print localized month names
256 * Allow functions to have a schema search path specified at creation time
257 * Allow substring/replace() to get/set bit values
258 * Allow to_char() on interval values to accumulate the highest unit
259   requested
260
261   Some special format flag would be required to request such
262   accumulation.  Such functionality could also be added to EXTRACT. 
263   Prevent accumulation that crosses the month/day boundary because of
264   the uneven number of days in a month.
265
266         o to_char(INTERVAL '1 hour 5 minutes', 'MI') => 65
267         o to_char(INTERVAL '43 hours 20 minutes', 'MI' ) => 2600 
268         o to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') => 0:1:19:20
269         o to_char(INTERVAL '3 years 5 months','MM') => 41
270
271 * Add sleep() function, remove from regress.c
272
273
274 Multi-Language Support
275 ======================
276
277 * Add NCHAR (as distinguished from ordinary varchar),
278 * Allow locale to be set at database creation
279
280   Currently locale can only be set during initdb.  No global tables have
281   locale-aware columns.  However, the database template used during
282   database creation might have locale-aware indexes.  The indexes would
283   need to be reindexed to match the new locale.
284
285 * Allow encoding on a per-column basis
286
287   Right now only one encoding is allowed per database.
288
289 * Support multiple simultaneous character sets, per SQL92
290 * Improve UTF8 combined character handling?
291 * Add octet_length_server() and octet_length_client()
292 * Make octet_length_client() the same as octet_length()?
293 * Fix problems with wrong runtime encoding conversion for NLS message files
294
295
296 Views / Rules
297 =============
298
299 * %Automatically create rules on views so they are updateable, per SQL99
300
301   We can only auto-create rules for simple views.  For more complex
302   cases users will still have to write rules.
303
304 * Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
305 * Allow NOTIFY in rules involving conditionals
306 * Allow VIEW/RULE recompilation when the underlying tables change
307
308
309 SQL Commands
310 ============
311
312 * Change LIMIT/OFFSET and FETCH/MOVE to use int8
313 * Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
314 * Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
315 * %Allow SET CONSTRAINTS to be qualified by schema/table name
316 * %Allow TRUNCATE ... CASCADE/RESTRICT
317
318   This is like DELETE CASCADE, but truncates.
319
320 * %Add a separate TRUNCATE permission
321
322   Currently only the owner can TRUNCATE a table because triggers are not
323   called, and the table is locked in exclusive mode.
324
325 * Allow PREPARE of cursors
326 * Allow PREPARE to automatically determine parameter types based on the SQL
327   statement
328 * Allow finer control over the caching of prepared query plans
329
330   Currently, queries prepared via the libpq API are planned on first
331   execute using the supplied parameters --- allow SQL PREPARE to do the
332   same.  Also, allow control over replanning prepared queries either
333   manually or automatically when statistics for execute parameters
334   differ dramatically from those used during planning.
335
336 * Allow LISTEN/NOTIFY to store info in memory rather than tables?
337
338   Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
339   such information in memory would improve performance.
340
341 * Add optional textual message to NOTIFY
342
343   This would allow an informational message to be added to the notify
344   message, perhaps indicating the row modified or other custom
345   information.
346
347 * Add a GUC variable to warn about non-standard SQL usage in queries
348 * Add MERGE command that does UPDATE/DELETE, or on failure, INSERT (rules,
349   triggers?)
350 * Add NOVICE output level for helpful messages like automatic sequence/index
351   creation
352 * %Add COMMENT ON for all cluster global objects (roles, databases
353   and tablespaces)
354 * %Make row-wise comparisons work per SQL spec
355 * Add RESET CONNECTION command to reset all session state
356
357   This would include resetting of all variables (RESET ALL), dropping of
358   temporary tables, removing any NOTIFYs, cursors, open transactions,
359   prepared queries, currval()s, etc.  This could be used  for connection
360   pooling.  We could also change RESET ALL to have this functionality.  
361   The difficult of this features is allowing RESET ALL to not affect 
362   changes made by the interface driver for its internal use.  One idea 
363   is for this to be a protocol-only feature.  Another approach is to 
364   notify the protocol when a RESET CONNECTION command is used.
365
366 * Add GUC to issue notice about queries that use unjoined tables
367 * Allow EXPLAIN to identify tables that were skipped because of 
368   constraint_exclusion
369 * Allow EXPLAIN output to be more easily processed by scripts
370
371
372 * CREATE
373
374         o Allow CREATE TABLE AS to determine column lengths for complex
375           expressions like SELECT col1 || col2
376
377         o Use more reliable method for CREATE DATABASE to get a consistent
378           copy of db?
379
380         o Add ON COMMIT capability to CREATE TABLE AS ... SELECT
381
382
383 * UPDATE
384         o Allow UPDATE to handle complex aggregates [update]?
385         o Allow an alias to be provided for the target table in
386           UPDATE/DELETE
387
388           This is not SQL-spec but many DBMSs allow it.
389
390         o Allow UPDATE tab SET ROW (col, ...) = (...) for updating multiple
391           columns
392
393
394 * ALTER
395
396         o %Have ALTER TABLE RENAME rename SERIAL sequence names
397         o Add ALTER DOMAIN to modify the underlying data type
398         o %Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
399         o %Allow ALTER TABLE to change constraint deferrability and actions
400         o Add missing object types for ALTER ... SET SCHEMA
401         o Allow ALTER TABLESPACE to move to different directories
402         o Allow databases to be moved to different tablespaces
403         o Allow moving system tables to other tablespaces, where possible
404
405           Currently non-global system tables must be in the default database
406           tablespace. Global system tables can never be moved.
407
408         o %Disallow dropping of an inherited constraint
409         o %Prevent child tables from altering or dropping constraints 
410           like CHECK that were inherited from the parent table
411
412
413 * CLUSTER
414
415         o Automatically maintain clustering on a table
416
417           This might require some background daemon to maintain clustering
418           during periods of low usage. It might also require tables to be only
419           paritally filled for easier reorganization.  Another idea would
420           be to create a merged heap/index data file so an index lookup would
421           automatically access the heap data too.  A third idea would be to
422           store heap rows in hashed groups, perhaps using a user-supplied
423           hash function.
424
425         o %Add default clustering to system tables
426
427           To do this, determine the ideal cluster index for each system
428           table and set the cluster setting during initdb.
429
430
431 * COPY
432
433         o Allow COPY to report error lines and continue
434
435           This requires the use of a savepoint before each COPY line is
436           processed, with ROLLBACK on COPY failure.
437
438         o %Have COPY return the number of rows loaded/unloaded?
439
440
441 * GRANT/REVOKE
442
443         o Allow column-level privileges
444         o %Allow GRANT/REVOKE permissions to be applied to all schema objects
445           with one command
446
447           The proposed syntax is:
448                 GRANT SELECT ON ALL TABLES IN public TO phpuser;
449                 GRANT SELECT ON NEW TABLES IN public TO phpuser;
450
451         * Allow GRANT/REVOKE permissions to be inherited by objects based on
452           schema permissions
453
454
455 * CURSOR
456
457         o Allow UPDATE/DELETE WHERE CURRENT OF cursor
458
459           This requires using the row ctid to map cursor rows back to the
460           original heap row. This become more complicated if WITH HOLD cursors
461           are to be supported because WITH HOLD cursors have a copy of the row
462           and no FOR UPDATE lock.
463
464         o Prevent DROP TABLE from dropping a row referenced by its own open
465           cursor?
466
467         o %Allow pooled connections to list all open WITH HOLD cursors
468
469           Because WITH HOLD cursors exist outside transactions, this allows
470           them to be listed so they can be closed.
471
472
473 * INSERT
474
475         o Allow INSERT/UPDATE of the system-generated oid value for a row
476         o Allow INSERT INTO tab (col1, ..) VALUES (val1, ..), (val2, ..)
477         o Allow INSERT/UPDATE ... RETURNING new.col or old.col
478
479           This is useful for returning the auto-generated key for an INSERT.
480           One complication is how to handle rules that run as part of
481           the insert.
482
483
484 * SHOW/SET
485
486         o Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
487           ANALYZE, and CLUSTER
488         o Add SET PATH for schemas?
489
490           This is basically the same as SET search_path.
491
492
493 * Server-Side Languages
494
495         o Fix PL/pgSQL RENAME to work on variables other than OLD/NEW
496         o Allow function parameters to be passed by name,
497           get_employee_salary(emp_id => 12345, tax_year => 2001)
498         o Add Oracle-style packages
499         o Add table function support to pltcl, plpython
500         o Add capability to create and call PROCEDURES
501         o Allow PL/pgSQL to handle %TYPE arrays, e.g. tab.col%TYPE[]
502         o Allow function argument names to be queries from PL/PgSQL
503         o Add MOVE to PL/pgSQL
504         o Add support for polymorphic arguments and return types to
505           languages other than PL/PgSQL
506         o Add support for OUT and INOUT parameters to languages other 
507           than PL/PgSQL
508
509
510 Clients
511 =======
512
513 * Add a libpq function to support Parse/DescribeStatement capability
514 * Prevent libpq's PQfnumber() from lowercasing the column name?
515 * Add PQescapeIdentifier() to libpq
516 * Have initdb set the input DateStyle (MDY or DMY) based on locale?
517 * Have pg_ctl look at PGHOST in case it is a socket directory?
518 * Allow pg_ctl to work properly with configuration files located outside
519   the PGDATA directory
520
521   pg_ctl can not read the pid file because it isn't located in the
522   config directory but in the PGDATA directory.  The solution is to
523   allow pg_ctl to read and understand postgresql.conf to find the
524   data_directory value.
525
526
527 * psql
528
529         o Have psql show current values for a sequence
530         o Move psql backslash database information into the backend, use
531           mnemonic commands? [psql]
532
533           This would allow non-psql clients to pull the same information out
534           of the database as psql.
535
536         o Fix psql's display of schema information (Neil)
537         o Allow psql \pset boolean variables to set to fixed values, rather
538           than toggle
539         o Consistently display privilege information for all objects in psql
540         o Improve psql's handling of multi-line queries
541
542           Currently, while \e saves a single query as one entry, interactive
543           queries are saved one line at a time.  Ideally all queries
544           whould be saved like \e does.
545
546         o Allow multi-line column values to align in the proper columns
547
548           If the second output column value is 'a\nb', the 'b' should appear
549           in the second display column, rather than the first column as it
550           does now.
551
552
553 * pg_dump
554
555         o %Have pg_dump use multi-statement transactions for INSERT dumps
556         o %Allow pg_dump to use multiple -t and -n switches [pg_dump]
557         o %Add dumping of comments on composite type columns
558         o %Add dumping of comments on index columns
559         o %Replace crude DELETE FROM method of pg_dumpall --clean for 
560           cleaning of roles with separate DROP commands
561         o Stop dumping CASCADE on DROP TYPE commands in clean mode
562         o %Add full object name to the tag field.  eg. for operators we need
563           '=(integer, integer)', instead of just '='.
564         o Add pg_dumpall custom format dumps?
565         o %Add CSV output format
566         o Update pg_dump and psql to use the new COPY libpq API (Christopher)
567         o Remove unnecessary function pointer abstractions in pg_dump source
568           code
569
570
571 * ecpg
572
573         o Docs
574
575           Document differences between ecpg and the SQL standard and
576           information about the Informix-compatibility module.
577
578         o Solve cardinality > 1 for input descriptors / variables?
579         o Add a semantic check level, e.g. check if a table really exists
580         o fix handling of DB attributes that are arrays
581         o Use backend PREPARE/EXECUTE facility for ecpg where possible
582         o Implement SQLDA
583         o Fix nested C comments
584         o %sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified
585         o Make SET CONNECTION thread-aware, non-standard?
586         o Allow multidimensional arrays
587         o Add internationalized message strings
588
589
590 Referential Integrity
591 =====================
592
593 * Add MATCH PARTIAL referential integrity
594 * Add deferred trigger queue file
595
596   Right now all deferred trigger information is stored in backend
597   memory.  This could exhaust memory for very large trigger queues.
598   This item involves dumping large queues into files.
599
600 * Change foreign key constraint for array -> element to mean element
601   in array?
602 * Allow DEFERRABLE UNIQUE constraints?
603 * Allow triggers to be disabled in only the current session.
604
605   This is currently possible by starting a multi-statement transaction,
606   modifying the system tables, performing the desired SQL, restoring the
607   system tables, and committing the transaction.  ALTER TABLE ...
608   TRIGGER requires a table lock so it is not ideal for this usage.
609
610 * With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
611
612   If the dump is known to be valid, allow foreign keys to be added
613   without revalidating the data.
614
615 * Allow statement-level triggers to access modified rows
616 * Support triggers on columns (Greg Sabino Mullane)
617 * Enforce referential integrity for system tables
618 * Allow AFTER triggers on system tables
619
620   System tables are modified in many places in the backend without going
621   through the executor and therefore not causing triggers to fire. To
622   complete this item, the functions that modify system tables will have
623   to fire triggers.
624
625
626 Dependency Checking
627 ===================
628
629 * Flush cached query plans when the dependent objects change
630 * Track dependencies in function bodies and recompile/invalidate
631
632   This is particularly important for references to temporary tables
633   in PL/PgSQL because PL/PgSQL caches query plans.  The only workaround
634   in PL/PgSQL is to use EXECUTE.  One complexity is that a function
635   might itself drop and recreate dependent tables, causing it to
636   invalidate its own query plan.
637
638
639 Exotic Features
640 ===============
641
642 * Add SQL99 WITH clause to SELECT
643 * Add SQL99 WITH RECURSIVE to SELECT
644 * Add pre-parsing phase that converts non-ISO syntax to supported
645   syntax
646
647   This could allow SQL written for other databases to run without
648   modification.
649
650 * Allow plug-in modules to emulate features from other databases
651 * SQL*Net listener that makes PostgreSQL appear as an Oracle database
652   to clients
653 * Allow queries across databases or servers with transaction
654   semantics
655
656   This can be done using dblink and two-phase commit.
657
658 * Add the features of packages
659
660         o  Make private objects accessable only to objects in the same schema
661         o  Allow current_schema.objname to access current schema objects
662         o  Add session variables
663         o  Allow nested schemas
664
665
666 Indexes
667 =======
668
669 * Allow inherited tables to inherit index, UNIQUE constraint, and primary
670   key, foreign key
671 * UNIQUE INDEX on base column not honored on INSERTs/UPDATEs from
672   inherited table:  INSERT INTO inherit_table (unique_index_col) VALUES
673   (dup) should fail
674
675   The main difficulty with this item is the problem of creating an index
676   that can span more than one table.
677
678 * Allow SELECT ... FOR UPDATE on inherited tables
679 * Add UNIQUE capability to non-btree indexes
680 * Prevent index uniqueness checks when UPDATE does not modify the column
681
682   Uniqueness (index) checks are done when updating a column even if the
683   column is not modified by the UPDATE.
684
685 * Allow the creation of on-disk bitmap indexes which can be quickly
686   combined with other bitmap indexes
687
688   Such indexes could be more compact if there are only a few distinct values.
689   Such indexes can also be compressed.  Keeping such indexes updated can be
690   costly.
691
692 * Allow use of indexes to search for NULLs
693
694   One solution is to create a partial index on an IS NULL expression.
695
696 * Allow accurate statistics to be collected on indexes with more than
697   one column or expression indexes, perhaps using per-index statistics
698 * Add fillfactor to control reserved free space during index creation
699 * Allow the creation of indexes with mixed ascending/descending specifiers
700 * Allow constraint_exclusion to work for UNIONs like it does for
701   inheritance, allow it to work for UPDATE and DELETE queries, and allow
702   it to be used for all queries with little performance impact
703
704
705 * GIST
706
707         o Add more GIST index support for geometric data types
708         o Allow GIST indexes to create certain complex index types, like
709           digital trees (see Aoki)
710
711 * Hash
712
713         o Pack hash index buckets onto disk pages more efficiently
714
715           Currently only one hash bucket can be stored on a page. Ideally
716           several hash buckets could be stored on a single page and greater
717           granularity used for the hash algorithm.
718
719         o Consider sorting hash buckets so entries can be found using a
720           binary search, rather than a linear scan
721
722         o In hash indexes, consider storing the hash value with or instead
723           of the key itself
724
725         o Add WAL logging for crash recovery
726         o Allow multi-column hash indexes
727
728
729 Fsync
730 =====
731
732 * Improve commit_delay handling to reduce fsync()
733 * Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
734
735   Ideally this requires a separate test program that can be run
736   at initdb time or optionally later.
737
738 * %Add an option to sync() before fsync()'ing checkpoint files
739 * Add program to test if fsync has a delay compared to non-fsync
740
741
742 Cache Usage
743 ===========
744
745 * Allow free-behind capability for large sequential scans, perhaps using
746   posix_fadvise()
747
748   Posix_fadvise() can control both sequential/random file caching and
749   free-behind behavior, but it is unclear how the setting affects other
750   backends that also have the file open, and the feature is not supported
751   on all operating systems.
752
753 * Speed up COUNT(*)
754
755   We could use a fixed row count and a +/- count to follow MVCC
756   visibility rules, or a single cached value could be used and
757   invalidated if anyone modifies the table.  Another idea is to
758   get a count directly from a unique index, but for this to be
759   faster than a sequential scan it must avoid access to the heap
760   to obtain tuple visibility information.
761
762 * Allow data to be pulled directly from indexes
763
764   Currently indexes do not have enough tuple visibility information 
765   to allow data to be pulled from the index without also accessing 
766   the heap.  One way to allow this is to set a bit to index tuples 
767   to indicate if a tuple is currently visible to all transactions 
768   when the first valid heap lookup happens.  This bit would have to 
769   be cleared when a heap tuple is expired.
770
771
772 * Consider automatic caching of queries at various levels:
773
774         o Parsed query tree
775         o Query execute plan
776         o Query results
777
778 * Allow sequential scans to take advantage of other concurrent
779   sequentiqal scans, also called "Synchronised Scanning"
780
781   One possible implementation is to start sequential scans from the lowest
782   numbered buffer in the shared cache, and when reaching the end wrap
783   around to the beginning, rather than always starting sequential scans
784   at the start of the table.
785
786
787 Vacuum
788 ======
789
790 * Improve speed with indexes
791
792   For large table adjustements during VACUUM FULL, it is faster to 
793   reindex rather than update the index.
794
795 * Reduce lock time during VACUUM FULL by moving tuples with read lock,
796   then write lock and truncate table
797
798   Moved tuples are invisible to other backends so they don't require a
799   write lock. However, the read lock promotion to write lock could lead
800   to deadlock situations.
801
802 * Maintain a map of recently-expired rows
803
804   This allows vacuum to target specific pages for possible free space 
805   without requiring a sequential scan.
806
807 * Auto-fill the free space map by scanning the buffer cache or by
808   checking pages written by the background writer
809 * Create a bitmap of pages that need vacuuming
810
811   Instead of sequentially scanning the entire table, have the background
812   writer or some other process record pages that have expired rows, then
813   VACUUM can look at just those pages rather than the entire table.  In
814   the event of a system crash, the bitmap would probably be invalidated.
815
816 * %Add system view to show free space map contents
817
818
819 * Auto-vacuum
820
821         o Use free-space map information to guide refilling
822         o %Issue log message to suggest VACUUM FULL if a table is nearly
823           empty?
824         o Improve xid wraparound detection by recording per-table rather
825           than per-database
826
827
828 Locking
829 =======
830
831 * Add code to detect an SMP machine and handle spinlocks accordingly
832   from distributted.net, http://www1.distributed.net/source,
833   in client/common/cpucheck.cpp
834
835   On SMP machines, it is possible that locks might be released shortly,
836   while on non-SMP machines, the backend should sleep so the process
837   holding the lock can complete and release it.
838
839 * Research use of sched_yield() for spinlock acquisition failure
840 * Fix priority ordering of read and write light-weight locks (Neil)
841
842
843 Startup Time Improvements
844 =========================
845
846 * Experiment with multi-threaded backend [thread]
847
848   This would prevent the overhead associated with process creation. Most
849   operating systems have trivial process creation time compared to
850   database startup overhead, but a few operating systems (WIn32,
851   Solaris) might benefit from threading.  Also explore the idea of
852   a single session using multiple threads to execute a query faster.
853
854 * Add connection pooling
855
856   It is unclear if this should be done inside the backend code or done
857   by something external like pgpool. The passing of file descriptors to
858   existing backends is one of the difficulties with a backend approach.
859
860
861 Write-Ahead Log
862 ===============
863
864 * Eliminate need to write full pages to WAL before page modification [wal]
865
866   Currently, to protect against partial disk page writes, we write
867   full page images to WAL before they are modified so we can correct any
868   partial page writes during recovery.  These pages can also be
869   eliminated from point-in-time archive files.
870
871         o  When off, write CRC to WAL and check file system blocks
872            on recovery
873
874            If CRC check fails during recovery, remember the page in case
875            a later CRC for that page properly matches.
876
877         o  Write full pages during file system write and not when
878            the page is modified in the buffer cache
879
880            This allows most full page writes to happen in the background
881            writer.  It might cause problems for applying WAL on recovery
882            into a partially-written page, but later the full page will be
883            replaced from WAL.
884
885 * Reduce WAL traffic so only modified values are written rather than
886   entire rows?
887 * Allow the pg_xlog directory location to be specified during initdb
888   with a symlink back to the /data location
889 * Allow WAL information to recover corrupted pg_controldata
890 * Find a way to reduce rotational delay when repeatedly writing
891   last WAL page
892
893   Currently fsync of WAL requires the disk platter to perform a full
894   rotation to fsync again. One idea is to write the WAL to different
895   offsets that might reduce the rotational delay.
896
897 * Allow buffered WAL writes and fsync
898
899   Instead of guaranteeing recovery of all committed transactions, this
900   would provide improved performance by delaying WAL writes and fsync
901   so an abrupt operating system restart might lose a few seconds of
902   committed transactions but still be consistent.  We could perhaps
903   remove the 'fsync' parameter (which results in an an inconsistent
904   database) in favor of this capability.
905
906
907 Optimizer / Executor
908 ====================
909
910 * Add missing optimizer selectivities for date, r-tree, etc
911 * Allow ORDER BY ... LIMIT # to select high/low value without sort or
912   index using a sequential scan for highest/lowest values
913
914   Right now, if no index exists, ORDER BY ... LIMIT # requires we sort
915   all values to return the high/low value.  Instead The idea is to do a 
916   sequential scan to find the high/low value, thus avoiding the sort.
917   MIN/MAX already does this, but not for LIMIT > 1.
918
919 * Precompile SQL functions to avoid overhead
920 * Create utility to compute accurate random_page_cost value
921 * Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
922 * Have EXPLAIN ANALYZE highlight poor optimizer estimates
923 * Consider using hash buckets to do DISTINCT, rather than sorting
924
925   This would be beneficial when there are few distinct values.
926
927 * Log queries where the optimizer row estimates were dramatically
928   different from the number of rows actually found?
929
930
931 Miscellaneous Performance
932 =========================
933
934 * Do async I/O for faster random read-ahead of data
935
936   Async I/O allows multiple I/O requests to be sent to the disk with
937   results coming back asynchronously.
938
939 * Use mmap() rather than SYSV shared memory or to write WAL files?
940
941   This would remove the requirement for SYSV SHM but would introduce
942   portability issues. Anonymous mmap (or mmap to /dev/zero) is required
943   to prevent I/O overhead.
944
945 * Consider mmap()'ing files into a backend?
946
947   Doing I/O to large tables would consume a lot of address space or
948   require frequent mapping/unmapping.  Extending the file also causes
949   mapping problems that might require mapping only individual pages,
950   leading to thousands of mappings.  Another problem is that there is no
951   way to _prevent_ I/O to disk from the dirty shared buffers so changes
952   could hit disk before WAL is written.
953
954 * Add a script to ask system configuration questions and tune postgresql.conf
955 * Use a phantom command counter for nested subtransactions to reduce
956   per-tuple overhead
957 * Research storing disk pages with no alignment/padding
958
959 Source Code
960 ===========
961
962 * Add use of 'const' for variables in source tree
963 * Rename some /contrib modules from pg* to pg_*
964 * Move some things from /contrib into main tree
965 * Move some /contrib modules out to their own project sites
966 * %Remove warnings created by -Wcast-align
967 * Move platform-specific ps status display info from ps_status.c to ports
968 * Add optional CRC checksum to heap and index pages
969 * Improve documentation to build only interfaces (Marc)
970 * Remove or relicense modules that are not under the BSD license, if possible
971 * %Remove memory/file descriptor freeing before ereport(ERROR)
972 * Acquire lock on a relation before building a relcache entry for it
973 * %Promote debug_query_string into a server-side function current_query()
974 * %Allow the identifier length to be increased via a configure option
975 * Remove Win32 rename/unlink looping if unnecessary
976 * Allow cross-compiling by generating the zic database on the target system
977 * Improve NLS maintenace of libpgport messages linked onto applications
978 * Allow ecpg to work with MSVC and BCC
979 * Add xpath_array() to /contrib/xml2 to return results as an array
980 * Allow building in directories containing spaces
981
982   This is probably not possible because 'gmake' and other compiler tools
983   do not fully support quoting of paths with spaces.
984
985 * Allow installing to directories containing spaces
986
987   This is possible if proper quoting is added to the makefiles for the
988   install targets.  Because PostgreSQL supports relocatable installs, it
989   is already possible to install into a directory that doesn't contain 
990   spaces and then copy the install to a directory with spaces.
991
992 * Fix sgmltools so PDFs can be generated with bookmarks
993 * %Clean up compiler warnings (especially with gcc version 4)
994
995
996 * Win32
997
998         o Remove configure.in check for link failure when cause is found
999         o Remove readdir() errno patch when runtime/mingwex/dirent.c rev
1000           1.4 is released
1001         o Remove psql newline patch when we find out why mingw outputs an
1002           extra newline
1003         o Allow psql to use readline once non-US code pages work with
1004           backslashes
1005         o Re-enable timezone output on log_line_prefix '%t' when a
1006           shorter timezone string is available
1007         o Fix problem with shared memory on the Win32 Terminal Server
1008         o %Add support for Unicode
1009
1010           To fix this, the data needs to be converted to/from UTF16/UTF8
1011           so the Win32 wcscoll() can be used, and perhaps other functions
1012           like towupper().  However, UTF8 already works with normal
1013           locales but provides no ordering or character set classes.
1014
1015
1016 * Wire Protocol Changes
1017
1018         o Allow dynamic character set handling
1019         o Add decoded type, length, precision
1020         o Use compression?
1021         o Update clients to use data types, typmod, schema.table.column names
1022           of result sets using new query protocol
1023
1024
1025 ---------------------------------------------------------------------------
1026
1027
1028 Developers who have claimed items are:
1029 --------------------------------------
1030 * Alvaro is Alvaro Herrera <alvherre@dcc.uchile.cl>
1031 * Andrew is Andrew Dunstan <andrew@dunslane.net>
1032 * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
1033 * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
1034     Family Health Network
1035 * Claudio is Claudio Natoli <claudio.natoli@memetrics.com>
1036 * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
1037 * Fabien is Fabien Coelho <coelho@cri.ensmp.fr>
1038 * Gavin is Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
1039 * Greg is Greg Sabino Mullane <greg@turnstep.com>
1040 * Hiroshi is Hiroshi Inoue <Inoue@tpf.co.jp>
1041 * Jan is Jan Wieck <JanWieck@Yahoo.com> of Afilias, Inc.
1042 * Joe is Joe Conway <mail@joeconway.com>
1043 * Karel is Karel Zak <zakkr@zf.jcu.cz>
1044 * Magnus is Magnus Hagander <mha@sollentuna.net>
1045 * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
1046 * Matthew T. O'Connor <matthew@zeut.net>
1047 * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
1048 * Neil is Neil Conway <neilc@samurai.com>
1049 * Oleg is Oleg Bartunov <oleg@sai.msu.su>
1050 * Peter is Peter Eisentraut <peter_e@gmx.net>
1051 * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
1052 * Rod is Rod Taylor <pg@rbt.ca>
1053 * Simon is Simon Riggs <simon@2ndquadrant.com>
1054 * Stephan is Stephan Szabo <sszabo@megazone23.bigpanda.com>
1055 * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
1056 * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat