]> granicus.if.org Git - postgresql/blob - doc/TODO
daf84ba00ef7d89b5ec5f0959b7e4c8cbcd7e5f4
[postgresql] / doc / TODO
1 TODO list for PostgreSQL
2 ========================
3 #A dash (-) marks changes that will appear in the upcoming 8.0 release.#
4
5 Bracketed items "[]" have more detail.
6
7 Current maintainer:     Bruce Momjian (pgman@candle.pha.pa.us)
8 Last updated:           Tue Aug 10 13:30:30 EDT 2004
9
10 The most recent version of this document can be viewed at the PostgreSQL web site, http://www.PostgreSQL.org.
11
12 Remove items before beta?
13
14 Urgent
15 ======
16
17 * Point-in-time data recovery using backup and write-ahead log,
18 * Create native Win32 port, http://momjian.postgresql.org/main/writings/pgsql/project/win32.html
19
20
21 Administration
22 ==============
23
24 * -Incremental backups
25 * Remove behavior of postmaster -o after making postmaster/postgres
26   flags unique
27 * -Allow configuration files to be specified in a different directory
28 * Allow limits on per-db/user connections
29 * Add group object ownership, so groups can rename/drop/grant on objects,
30   so we can implement roles
31 * -Add the concept of dataspaces/tablespaces (Gavin)
32 * -Allow logging of only data definition(DDL), or DDL and modification statements
33 * -Allow log lines to include session-level information, like database and user
34 * Allow server log information to be output as INSERT statements
35
36   This would allow server log information to be easily loaded into
37   a database for analysis.
38
39 * Prevent default re-use of sysids for dropped users and groups
40
41   Currently, if a user is removed while he still owns objects, a new
42   user given might be given their user id and inherit the
43   previous users objects.
44
45 * Prevent dropping user that still owns objects, or auto-drop the objects
46 * Allow pooled connections to list all prepared queries
47
48   This would allow an application inheriting a pooled connection to know
49   the queries prepared in the current session.
50
51 * Allow major upgrades without dump/reload, perhaps using pg_upgrade
52 * Have SHOW ALL and pg_settings show descriptions for server-side variables
53 * -Allow external interfaces to extend the GUC variable set
54 * Allow GRANT/REVOKE permissions to be given to all schema objects with one 
55   command
56 * Remove unreferenced table files created by transactions that were
57   in-progress when the server terminated abruptly
58 * Allow reporting of which objects are in which tablespaces
59
60   This item is difficult because a tablespace can contain objects from
61   multiple databases. There is a server-side function that returns the
62   databases which use a specific tablespace, so this requires a tool
63   that will call that function and connect to each database to find the
64   objects in each database for that tablespace.
65
66 * Allow database recovery where tablespaces can't be created
67
68   When a pg_dump is restored, all tablespaces will attempt to be created
69   in their original locations. If this fails, the user must be able to 
70   adjust the restore process.
71
72 * Add "include file" functionality in postgresql.conf
73 * Add session start time and last statement time to pg_stat_activity
74 * Allow server logs to be remotely read using SQL commands
75 * Allow server configuration parameters to be remotely modified
76 * Allow administrators to safely terminate individual sessions
77
78   Right now, SIGTERM will terminate a session, but it is treated as
79   though the postmaster has paniced and shared memory might not be
80   cleaned up properly.  A new signal is needed for safe termination.
81
82 * Un-comment all variables in postgresql.conf
83
84   By not showing commented-out variables, we discourage people from 
85   thinking that re-commenting a variable returns it to its default.
86
87 * Allow point-in-time recovery to archive partially filled write-ahead 
88   logs
89
90   Currently only full WAL files are archived. This means that the most
91   recent transactions aren't available for recovery in case of a disk
92   failure.
93
94 * Create dump tool for write-ahead logs for use in determining
95   transaction id for point-in-time recovery
96 * Improve replication solutions
97         o Automatic failover
98
99         The proper solution to this will probably the use of a master/slave
100         replication solution like Sloney and a connection pooling tool like
101         pgpool.
102
103         o Load balancing
104
105         You can use any of the master/slave replication servers to use a
106         standby server for data warehousing. To allow read/write queries to
107         multiple servers, you need multi-master replication like pgcluster.
108
109         o Allow replication over unreliable or non-persistent links
110
111
112 Data Types
113 ==========
114
115 * Remove Money type, add money formatting for decimal type
116 * -Change factorial to return a numeric (Gavin)
117 * Change NUMERIC to enforce the maximum precision, and increase it
118 * Add function to return compressed length of TOAST data values
119 * Allow INET subnet tests with non-constants to be indexed
120 * Add transaction_timestamp(), statement_timestamp(), clock_timestamp() functionality
121
122   Current CURRENT_TIMESTAMP returns the start time of the current
123   transaction, and gettimeofday() returns the wallclock time. This will
124   make time reporting more consistent and will allow reporting of
125   the statement start time.
126
127 * Have sequence dependency track use of DEFAULT sequences,
128   seqname.nextval (?)
129 * Disallow changing default expression of a SERIAL column (?)
130 * Allow infinite dates just like infinite timestamps
131 * -Allow pg_dump to dump sequences using NO_MAXVALUE and NO_MINVALUE
132 * -Prevent whole-row references from leaking memory, e.g. SELECT COUNT(tab.*)
133 * Have initdb set DateStyle based on locale?
134 * Add pg_get_acldef(), pg_get_typedefault(), and pg_get_attrdef()
135 * Allow to_char to print localized month names
136 * Allow functions to have a search path specified at creation time
137 * -Make LENGTH() of CHAR() not count trailing spaces
138 * Allow substring/replace() to get/set bit values
139 * Add GUC variable to allow output of interval values in ISO8601 format
140 * -Support composite types as table columns
141 * Fix data types where equality comparison isn't intuitive, e.g. box
142
143
144 * ARRAYS
145         o Allow nulls in arrays
146         o Allow MIN()/MAX() on arrays
147         o Delay resolution of array expression type so assignment coercion 
148           can be performed on empty array expressions
149         o Modify array literal representation to handle array index lower bound
150           of other than one
151
152
153 * BINARY DATA
154         o Improve vacuum of large objects, like /contrib/vacuumlo (?)
155         o Add security checking for large objects
156
157         Currently large objects entries do not have owners. Permissions can
158         only be set at the pg_largeobject table level.
159
160         o Auto-delete large objects when referencing row is deleted
161
162         o Allow read/write into TOAST values like large objects
163
164         This requires the TOAST column to be stored EXTERNAL.
165
166
167 Multi-Language Support
168 ======================
169
170 * Add NCHAR (as distinguished from ordinary varchar),
171 * Allow locale to be set at database creation
172
173   Currently locale can only be set during initdb.
174
175 * Allow encoding on a per-column basis
176
177   Right now only one encoding is allowed per database.
178
179 * Optimize locale to have minimal performance impact when not used
180 * Support multiple simultaneous character sets, per SQL92
181 * Improve Unicode combined character handling (?)
182 * Add octet_length_server() and octet_length_client()
183 * Make octet_length_client() the same as octet_length()?
184 * -Prevent mismatch of frontend/backend encodings from converting bytea
185   data from being interpreted as encoded strings
186 * -Fix upper()/lower() to work for multibyte encodings
187
188
189 Views / Rules
190 =============
191
192 * Automatically create rules on views so they are updateable, per SQL92 [view]
193 * Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
194 * Allow NOTIFY in rules involving conditionals
195 * Have views on temporary tables exist in the temporary namespace
196 * Allow temporary views on non-temporary tables
197 * Allow RULE recompilation
198
199
200 Indexes
201 =======
202
203 * -Order duplicate index entries on creation by ctid for faster heap lookups
204 * Allow inherited tables to inherit index, UNIQUE constraint, and primary
205   key, foreign key  [inheritance]
206 * UNIQUE INDEX on base column not honored on inserts/updates from
207   inherited table:  INSERT INTO inherit_table (unique_index_col) VALUES
208   (dup) should fail [inheritance]
209
210   The main difficulty with this item is the problem of creating an index
211   that can spam more than one table.
212
213 * Add UNIQUE capability to non-btree indexes
214 * Add rtree index support for line, lseg, path, point
215 * Use indexes for MIN() and MAX()
216
217   MIN/MAX queries can already be rewritten as SELECT col FROM tab ORDER
218   BY col {DESC} LIMIT 1. Completing this item involves making this
219   transformation automatically.
220
221 * Use index to restrict rows returned by multi-key index when used with
222   non-consecutive keys to reduce heap accesses
223
224   For an index on col1,col2,col3, and a WHERE clause of col1 = 5 and
225   col3 = 9, spin though the index checking for col1 and col3 matches,
226   rather than just col1
227
228 * -Be smarter about insertion of already-ordered data into btree index
229 * Prevent index uniqueness checks when UPDATE does not modify the column
230
231   Uniqueness (index) checks are done when updating a column even if the
232   column is not modified by the UPDATE.
233
234 * Fetch heap pages matching index entries in sequential order [performance]
235
236   Rather than randomly accessing heap pages based on index entries, mark
237   heap pages needing access in a bitmap and do the lookups in sequential
238   order. Another method would be to sort heap ctids matching the index
239   before accessing the heap rows.
240
241 * Use bitmaps to combine existing indexes [performance]
242
243   Bitmap indexes allow single indexed columns to be combined to
244   dynamically create a composite index to match a specific query. Each
245   index is a bitmap, and the bitmaps are AND'ed or OR'ed to be combined.
246
247 * Allow use of indexes to search for NULLs
248
249   One solution is to create a partial index on an IS NULL expression.
250
251 * -Allow SELECT * FROM tab WHERE int2col = 4 to use int2col index, int8,
252   float4, numeric/decimal too
253 * Add concurrency to GIST
254 * Pack hash index buckets onto disk pages more efficiently
255
256   Currently no only one hash bucket can be stored on a page. Ideally
257   several hash buckets could be stored on a single page and greater
258   granularity used for the hash algorithm.
259
260
261 Commands
262 ========
263
264 * Add BETWEEN ASYMMETRIC/SYMMETRIC
265 * Change LIMIT/OFFSET to use int8
266 * CREATE TABLE AS can not determine column lengths from expressions [atttypmod]
267 * Allow UPDATE to handle complex aggregates [update] (?)
268 * -Allow command blocks to ignore certain types of errors
269 * Allow backslash handling in quoted strings to be disabled for portability
270
271   The use of C-style backslashes (.e.g. \n, \r) in quoted strings is not
272   SQL-spec compliant, so allow such handling to be disabled.
273
274 * Allow an alias to be provided for the target table in UPDATE/DELETE
275
276   This is not SQL-spec but many DBMSs allow it.
277
278 * Allow additional tables to be specified in DELETE for joins
279
280   UPDATE already allows this (UPDATE...FROM) but we need similar
281   functionality in DELETE.  It's been agreed that the keyword should 
282   be USING, to avoid anything as confusing as DELETE FROM a FROM b.
283
284 * Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
285 * Allow REINDEX to rebuild all database indexes, remove /contrib/reindex
286 * Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
287 * Add a schema option to createlang
288 * -Allow savepoints / nested transactions [transactions] (Alvaro)
289 * -Use nested transactions to prevent syntax errors from aborting a transaction
290 * Allow UPDATE tab SET ROW (col, ...) = (...) for updating multiple columns
291 * Allow SET CONSTRAINTS to be qualified by schema/table name
292 * -Prevent COMMENT ON DATABASE from using a database name
293 * -Add NO WAIT LOCKs
294 * Allow TRUNCATE ... CASCADE/RESTRICT
295 * Allow PREPARE of cursors
296 * Allow PREPARE to automatically determine parameter types based on the SQL 
297   statement
298 * Allow LISTEN/NOTIFY to store info in memory rather than tables?
299
300   Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
301   such information in memory would improve performance.
302
303 * -COMMENT ON [ CAST | CONVERSION | OPERATOR CLASS | LARGE OBJECT | LANGUAGE ] 
304   (Christopher) 
305 * Dump large object comments in custom dump format
306 * Add optional textual message to NOTIFY
307
308   This would allow an informational message to be added to the notify
309   message, perhaps indicating the row modified or other custom
310   information.
311
312 * -Allow more ISOLATION LEVELS to be accepted
313 * Allow CREATE TABLE foo (f1 INT CHECK (f1 > 0) CHECK (f1 < 10)) to work
314   by searching for non-conflicting constraint names, and prefix with
315   table name?
316 * Use more reliable method for CREATE DATABASE to get a consistent copy
317   of db?
318
319   Currently the system uses the operating system COPY command to create
320   new database.
321
322 * Add C code to copy directories for use in creating new databases
323 * -Have psql \dn show only visible temp schemas using current_schemas()
324 * -Have psql '\i ~/<tab><tab>' actually load files it displays from home dir
325 * Ignore temporary tables from other sessions when processing
326   inheritance?
327 * -Add GUC setting to make created tables default to WITHOUT OIDS
328 * Have pg_ctl look at PGHOST in case it is a socket directory?
329 * Allow column-level GRANT/REVOKE privileges
330 * Add a session mode to warn about non-standard SQL usage in queries
331 * Add MERGE command that does UPDATE/DELETE, or on failure, INSERT (rules, triggers?)
332 * Add ON COMMIT capability to CREATE TABLE AS SELECT
333 * Add NOVICE output level for helpful messages like automatic sequence/index creation
334 * Add COMMENT ON for all cluster global objects (users, groups,
335   databases and tablespaces)
336
337 * ALTER
338         o -ALTER TABLE ADD COLUMN does not honor DEFAULT and non-CHECK CONSTRAINT
339         o -ALTER TABLE ADD COLUMN column DEFAULT should fill existing
340           rows with DEFAULT value
341         o -ALTER TABLE ADD COLUMN column SERIAL doesn't create sequence because
342           of the item above
343         o Have ALTER TABLE RENAME rename SERIAL sequence names
344         o -Allow ALTER TABLE to modify column lengths and change to binary
345           compatible types
346         o -Add ALTER DATABASE ... OWNER TO newowner
347         o Add ALTER DOMAIN TYPE
348         o Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
349         o Allow ALTER TABLE to change constraint deferrability and actions
350         o Disallow dropping of an inherited constraint
351         o Allow objects to be moved to different schemas
352         o Allow ALTER TABLESPACE to move to different directories
353         o Allow databases, schemas, and indexes to be moved to different 
354           tablespaces
355         o Allow moving system tables to other tablespaces, where possible
356
357         Currently non-global system tables must be in the default database
358         schema. Global system tables can never be moved.
359
360         o -Add ALTER DOMAIN, AGGREGATE, CONVERSION ... OWNER TO
361         o -Add ALTER SEQUENCE ... OWNER TO
362
363 * CLUSTER
364         o Automatically maintain clustering on a table
365
366         This would require some background daemon to restore clustering
367         during periods of low usage. It might also require tables to be only
368         paritally filled for easier reorganization.
369
370         o -Add ALTER TABLE table SET WITHOUT CLUSTER (Christopher)
371         o Add default clustering to system tables
372
373         To do this, determine the ideal cluster index for each system
374         table and set the cluster setting during initdb.
375
376 * COPY
377         o -Allow dump/load of CSV format
378         o Allow COPY to report error lines and continue
379         
380         This requires the use of a savepoint before each COPY line is
381         processed, with ROLLBACK on COPY failure.
382
383         o Allow COPY to understand \x as a hex byte
384         o Have COPY return the number of rows loaded/unloaded (?)
385
386 * CURSOR
387         o Allow UPDATE/DELETE WHERE CURRENT OF cursor
388         
389         This requires using the row ctid to map cursor rows back to the
390         original heap row. This become more complicated if WITH HOLD cursors
391         are to be supported because WITH HOLD cursors have a copy of the row
392         and no FOR UPDATE lock.
393
394         o Prevent DROP TABLE from dropping a row referenced by its own open
395           cursor (?)
396
397         o Allow pooled connections to list all open WITH HOLD cursors
398
399         Because WITH HOLD cursors exist outside transactions, this allows
400         them to be listed so they can be closed.
401
402 * INSERT
403         o Allow INSERT/UPDATE of the system-generated oid value for a row
404         o Allow INSERT INTO tab (col1, ..) VALUES (val1, ..), (val2, ..)
405         o Allow INSERT/UPDATE ... RETURNING new.col or old.col
406         
407         This is useful for returning the auto-generated key for an INSERT.
408         One complication is how to handle rules that run as part of
409         the insert.
410
411 * SHOW/SET
412         o Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
413           ANALYZE, and CLUSTER
414         o Add SET PATH for schemas (?)
415
416         This is basically the same as SET search_path.
417          
418         o Prevent conflicting SET options from being set
419
420         This requires a checking function to be called after the server
421         configuration file is read.
422
423 * SERVER-SIDE LANGUAGES
424         o Allow PL/PgSQL's RAISE function to take expressions (?)
425
426         Currently only constants are supported.
427
428         o Change PL/PgSQL to use palloc() instead of malloc()
429         o -Allow Java server-side programming
430         o Handle references to temporary tables that are created, destroyed, 
431           then recreated during a session, and EXECUTE is not used
432           
433         This requires the cached PL/PgSQL byte code to be invalidated when
434         an object referenced in the function is changed.
435
436     o Fix PL/pgSQL RENAME to work on variables other than OLD/NEW
437         o Improve PL/PgSQL exception handling using savepoints
438         o -Allow PL/pgSQL parameters to be specified by name and type during definition
439         o Allow function parameters to be passed by name,
440           get_employee_salary(emp_id => 12345, tax_year => 2001)
441         o Add Oracle-style packages
442         o Add table function support to pltcl, plperl, plpython (?)
443         o Allow PL/pgSQL to name columns by ordinal position, e.g. rec.(3)
444         o Allow PL/pgSQL EXECUTE query_var INTO record_var;
445         o Add capability to create and call PROCEDURES
446         o Allow PL/pgSQL to handle %TYPE arrays, e.g. tab.col%TYPE[]
447
448
449 Clients
450 =======
451
452 * Add XML output to pg_dump and COPY
453
454   We already allow XML to be stored in the database, and XPath queries
455   can be used on that data using /contrib/xml2. It also supports XSLT
456   transformations.
457     
458 * -Allow psql \du to show users, and add \dg for groups
459 * Add a libpq function to support Parse/DescribeStatement capability
460 * Prevent libpq's PQfnumber() from lowercasing the column name (?)
461 * -Allow pg_dump to dump CREATE CONVERSION (Christopher)
462 * -Make pg_restore continue after errors, so it acts more like pg_dump scripts
463 * Have psql show current values for a sequence
464 * Allow pg_dumpall to use non-text output formats
465 * Have pg_dump use multi-statement transactions for INSERT dumps
466 * Move psql backslash database information into the backend, use mnemonic
467   commands? [psql]
468
469   This would allow non-psql clients to pull the same information out of
470   the database as psql.
471
472 * Allow pg_dump to use multiple -t and -n switches
473
474   This should be done by allowing a '-t schema.table' syntax.
475
476 * Fix oid2name and dbsize for tablespaces
477 * Consistently display privilege information for all objects in psql
478
479 * ECPG (?)
480         o Docs
481
482         Document differences between ecpg and the SQL standard and
483         information about the Informix-compatibility module.
484
485         o -Implement SET DESCRIPTOR
486         o Solve cardinality > 1 for input descriptors / variables (?)
487         o Improve error handling (?)
488         o Add a semantic check level, e.g. check if a table really exists
489         o fix handling of DB attributes that are arrays
490         o Use backend PREPARE/EXECUTE facility for ecpg where possible
491         o Implement SQLDA
492         o Fix nested C comments
493         o sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified
494         o Make SET CONNECTION thread-aware, non-standard?
495         o Allow multidimensional arrays
496
497
498 Referential Integrity
499 =====================
500
501 * Add MATCH PARTIAL referential integrity
502 * Add deferred trigger queue file
503
504   Right now all deferred trigger information is stored in backend
505   memory.  This could exhaust memory for very large trigger queues.
506   This item involves dumping large queues into files.
507
508 * Implement dirty reads or shared row locks and use them in RI triggers (?)
509 * Enforce referential integrity for system tables
510 * Change foreign key constraint for array -> element to mean element
511   in array (?)
512 * Allow DEFERRABLE UNIQUE constraints (?)
513 * Allow triggers to be disabled [trigger]
514
515   Currently the only way to disable triggers is to modify the system
516   tables.
517
518 * With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
519
520   If the dump is known to be valid, allow foreign keys to be added
521   without revalidating the data.
522
523 * Allow statement-level triggers to access modified rows
524 * Support triggers on columns
525 * Have AFTER triggers execute after the appropriate SQL statement in a 
526   function, not at the end of the function
527 * -Print table names with constraint names in error messages, or make constraint
528   names unique within a schema
529 * -Issue NOTICE if foreign key data requires costly test to match primary key
530 * Remove CREATE CONSTRAINT TRIGGER
531
532   This was used in older releases to dump referential integrity
533   constraints.
534
535 * Allow AFTER triggers on system tables
536
537   System tables are modified in many places in the backend without going
538   through the executor and therefore not causing triggers to fire. To
539   complete this item, the functions that modify system tables will have
540   to fire triggers.
541
542
543 Dependency Checking
544 ===================
545
546 * Flush cached query plans when the dependent objects change
547 * -Use dependency information to dump data in proper order
548 * -Have pg_dump -c clear the database using dependency information
549 * Track dependencies in function bodies and recompile/invalidate
550
551
552 Exotic Features
553 ===============
554
555 * Add SQL99 WITH clause to SELECT
556 * Add SQL99 WITH RECURSIVE to SELECT
557 * Add pre-parsing phase that converts non-ANSI syntax to supported
558   syntax
559
560   This could allow SQL written for other databases to run without
561   modification.
562
563 * Allow plug-in modules to emulate features from other databases
564 * SQL*Net listener that makes PostgreSQL appear as an Oracle database
565   to clients
566 * Allow queries across databases or servers with transaction
567   semantics
568         
569   Right now contrib/dblink can be used to issue such queries except it
570   does not have locking or transaction semantics. Two-phase commit is
571   needed to enable transaction semantics.
572
573 * Add two-phase commit
574
575   This will involve adding a way to respond to commit failure by either
576   taking the server into offline/readonly mode or notifying the
577   administrator
578
579
580 PERFORMANCE
581 ===========
582
583
584 Fsync
585 =====
586
587 * Improve commit_delay handling to reduce fsync()
588 * Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
589 * Allow multiple blocks to be written to WAL with one write()
590 * Add an option to sync() before fsync()'ing checkpoint files
591
592
593 Cache
594 =====
595 * Add free-behind capability for large sequential scans [fadvise]
596 * Consider use of open/fcntl(O_DIRECT) to minimize OS caching
597 * Cache last known per-tuple offsets to speed long tuple access
598
599   While column offsets are already cached, the cache can not be used if
600   the tuple has NULLs or TOAST columns because these values change the
601   typical column offsets. Caching of such offsets could be accomplished
602   by remembering the previous offsets and use them again if the row has
603   the same pattern.
604
605 * Speed up COUNT(*)
606
607   We could use a fixed row count and a +/- count to follow MVCC
608   visibility rules, or a single cached value could be used and
609   invalidated if anyone modifies the table. [count]
610
611
612 Vacuum
613 ======
614
615 * Improve speed with indexes
616
617   For large table adjustements during vacuum, it is faster to reindex
618   rather than update the index.
619
620 * Reduce lock time by moving tuples with read lock, then write
621   lock and truncate table
622
623   Moved tuples are invisible to other backends so they don't require a
624   write lock. However, the read lock promotion to write lock could lead
625   to deadlock situations.
626
627 * -Provide automatic running of vacuum in the background in backend
628   rather than in /contrib (Matthew)
629 * Allow free space map to be auto-sized or warn when it is too small
630
631   The free space map is in shared memory so resizing is difficult.
632
633 * Maintain a map of recently-expired rows
634
635   This allows vacuum to reclaim free space without requiring
636   a sequential scan
637
638
639 Locking
640 =======
641
642 * Make locking of shared data structures more fine-grained
643
644   This requires that more locks be acquired but this would reduce lock
645   contention, improving concurrency.
646
647 * Add code to detect an SMP machine and handle spinlocks accordingly
648   from distributted.net, http://www1.distributed.net/source, 
649   in client/common/cpucheck.cpp
650
651   On SMP machines, it is possible that locks might be released shortly,
652   while on non-SMP machines, the backend should sleep so the process
653   holding the lock can complete and release it.
654
655 * Improve SMP performance on i386 machines
656
657   i386-based SMP machines can generate excessive context switching
658   caused by lock failure in high concurrency situations. This may be
659   caused by CPU cache line invalidation inefficiencies.
660
661 * Research use of sched_yield() for spinlock acquisition failure
662
663
664 Startup Time
665 ============
666
667 * Experiment with multi-threaded backend [thread]
668
669   This would prevent the overhead associated with process creation. Most
670   operating systems have trivial process creation time compared to
671   database startup overhead, but a few operating systems (WIn32,
672   Solaris) might benefit from threading.
673
674 * Add connection pooling [pool]
675
676   It is unclear if this should be done inside the backend code or done
677   by something external like pgpool. The passing of file descriptors to
678   existing backends is one of the difficulties with a backend approach.
679
680
681 Write-Ahead Log
682 ===============
683
684 * Eliminate need to write full pages to WAL before page modification [wal]
685
686   Currently, to protect against partial disk page writes, we write the
687   full page images to WAL before they are modified so we can correct any
688   partial page writes during recovery.
689
690 * Reduce WAL traffic so only modified values are written rather than
691   entire rows (?)
692 * Turn off after-change writes if fsync is disabled
693
694   If fsync is off, there is no purpose in writing full pages to WAL
695
696 * Add WAL index reliability improvement to non-btree indexes
697 * Allow the pg_xlog directory location to be specified during initdb
698   with a symlink back to the /data location
699
700 * Allow WAL information to recover corrupted pg_controldata
701 * Find a way to reduce rotational delay when repeatedly writing
702   last WAL page
703   
704   Currently fsync of WAL requires the disk platter to perform a full
705   rotation to fsync again. One idea is to write the WAL to different
706   offsets that might reduce the rotational delay.
707
708
709 Optimizer / Executor
710 ====================
711
712 * Add missing optimizer selectivities for date, r-tree, etc
713 * Allow ORDER BY ... LIMIT 1 to select high/low value without sort or
714   index using a sequential scan for highest/lowest values
715
716   If only one value is needed, there is no need to sort the entire
717   table. Instead a sequential scan could get the matching value.
718
719 * Precompile SQL functions to avoid overhead
720 * Add utility to compute accurate random_page_cost value
721 * Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
722 * Allow sorting, temp files, temp tables to use multiple work directories
723
724   This allows the I/O load to be spread across multiple disk drives.
725 * Have EXPLAIN ANALYZE highlight poor optimizer estimates
726 * Use CHECK constraints to influence optimizer decisions
727
728   CHECK constraints contain information about the distribution of values
729   within the table. This is also useful for implementing subtables where
730   a tables content is distributed across several subtables.
731
732
733 Miscellaneous
734 =============
735
736 * Do async I/O for faster random read-ahead of data
737
738   Async I/O allows multiple I/O requests to be sent to the disk with
739   results coming back asynchronously.
740     
741 * Use mmap() rather than SYSV shared memory or to write WAL files (?) [mmap]
742
743   This would remove the requirement for SYSV SHM but would introduce
744   portability issues. Anonymous mmap is required to prevent I/O
745   overhead.
746
747 * Add a script to ask system configuration questions and tune postgresql.conf
748 * -Use background process to write dirty shared buffers to disk
749 * Use a phantom command counter for nested subtransactions to reduce
750   tuple overhead
751
752
753 Source Code
754 ===========
755
756 * Add use of 'const' for variables in source tree
757 * Rename some /contrib modules from pg* to pg_*
758 * Move some things from /contrib into main tree
759 * Remove warnings created by -Wcast-align
760 * Move platform-specific ps status display info from ps_status.c to ports
761 * Improve access-permissions check on data directory in Cygwin (Tom)
762 * Add optional CRC checksum to heap and index pages
763 * -Change representation of whole-tuple parameters to functions
764 * Clarify use of 'application' and 'command' tags in SGML docs
765 * Better document ability to build only certain interfaces (Marc)
766 * Remove or relicense modules that are not under the BSD license, if possible
767 * Remove memory/file descriptor freeing before ereport(ERROR)
768 * Acquire lock on a relation before building a relcache entry for it
769 * Research interaction of setitimer() and sleep() used by statement_timeout
770 * -Add checks for fclose() failure (Tom)
771 * -Change CVS ID to PostgreSQL
772 * -Exit postmaster if postgresql.conf can not be opened
773 * Rename /scripts directory because they are all C programs now
774 * Promote debug_query_string into a server-side function current_query()
775 * Allow the identifier length to be increased via a configure option
776 * Allow binaries to be statically linked so they are more easily relocated
777
778
779 * Wire Protocol Changes
780         o Allow dynamic character set handling
781         o Add decoded type, length, precision
782         o Use compression?
783         o Update clients to use data types, typmod, schema.table.column names of
784           result sets using new query protocol
785
786
787 ---------------------------------------------------------------------------
788
789
790 Developers who have claimed items are:
791 --------------------------------------
792 * Alvaro is Alvaro Herrera <alvherre@dcc.uchile.cl>
793 * Andrew is Andrew Dunstan <andrew@dunslane.net>
794 * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
795 * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
796     Family Health Network
797 * Claudio is Claudio Natoli <claudio.natoli@memetrics.com>
798 * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
799 * Fabien is Fabien Coelho <coelho@cri.ensmp.fr>
800 * Gavin is Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
801 * Greg is Greg Sabino Mullane <greg@turnstep.com>
802 * Hiroshi is Hiroshi Inoue <Inoue@tpf.co.jp>
803 * Jan is Jan Wieck <JanWieck@Yahoo.com> of Afilias, Inc.
804 * Joe is Joe Conway <mail@joeconway.com>
805 * Karel is Karel Zak <zakkr@zf.jcu.cz>
806 * Kris is Kris Jurka 
807 * Magnus is Magnus Hagander <mha@sollentuna.net>
808 * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
809 * Matthew T. O'Connor <matthew@zeut.net>
810 * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
811 * Neil is Neil Conway <neilc@samurai.com>
812 * Oleg is Oleg Bartunov <oleg@sai.msu.su>
813 * Peter is Peter Eisentraut <peter_e@gmx.net>
814 * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
815 * Rod is Rod Taylor <pg@rbt.ca>
816 * Simon is Simon Riggs
817 * Stephan is Stephan Szabo <sszabo@megazone23.bigpanda.com>
818 * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
819 * Teodor is 
820 * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat