]> granicus.if.org Git - postgresql/blob - doc/TODO
Add:
[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:           Thu Aug 12 22:47:54 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 finer control over the caching of prepared query plans
299
300   Currently, queries prepared via the libpq API are planned on first
301   execute using the supplied parameters --- allow SQL PREPARE to do the
302   same.  Also, allow control over replanning prepared queries either
303   manually or automatically when statistics for execute parameters
304   differ dramatically from those used during planning.
305
306 * Allow LISTEN/NOTIFY to store info in memory rather than tables?
307
308   Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
309   such information in memory would improve performance.
310
311 * -COMMENT ON [ CAST | CONVERSION | OPERATOR CLASS | LARGE OBJECT | LANGUAGE ] 
312   (Christopher) 
313 * Dump large object comments in custom dump format
314 * Add optional textual message to NOTIFY
315
316   This would allow an informational message to be added to the notify
317   message, perhaps indicating the row modified or other custom
318   information.
319
320 * -Allow more ISOLATION LEVELS to be accepted
321 * Allow CREATE TABLE foo (f1 INT CHECK (f1 > 0) CHECK (f1 < 10)) to work
322   by searching for non-conflicting constraint names, and prefix with
323   table name?
324 * Use more reliable method for CREATE DATABASE to get a consistent copy
325   of db?
326
327   Currently the system uses the operating system COPY command to create
328   new database.
329
330 * Add C code to copy directories for use in creating new databases
331 * -Have psql \dn show only visible temp schemas using current_schemas()
332 * -Have psql '\i ~/<tab><tab>' actually load files it displays from home dir
333 * Ignore temporary tables from other sessions when processing
334   inheritance?
335 * -Add GUC setting to make created tables default to WITHOUT OIDS
336 * Have pg_ctl look at PGHOST in case it is a socket directory?
337 * Allow column-level GRANT/REVOKE privileges
338 * Add a session mode to warn about non-standard SQL usage in queries
339 * Add MERGE command that does UPDATE/DELETE, or on failure, INSERT (rules, triggers?)
340 * Add ON COMMIT capability to CREATE TABLE AS SELECT
341 * Add NOVICE output level for helpful messages like automatic sequence/index creation
342 * Add COMMENT ON for all cluster global objects (users, groups,
343   databases and tablespaces)
344
345 * ALTER
346         o -ALTER TABLE ADD COLUMN does not honor DEFAULT and non-CHECK CONSTRAINT
347         o -ALTER TABLE ADD COLUMN column DEFAULT should fill existing
348           rows with DEFAULT value
349         o -ALTER TABLE ADD COLUMN column SERIAL doesn't create sequence because
350           of the item above
351         o Have ALTER TABLE RENAME rename SERIAL sequence names
352         o -Allow ALTER TABLE to modify column lengths and change to binary
353           compatible types
354         o -Add ALTER DATABASE ... OWNER TO newowner
355         o Add ALTER DOMAIN TYPE
356         o Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
357         o Allow ALTER TABLE to change constraint deferrability and actions
358         o Disallow dropping of an inherited constraint
359         o Allow objects to be moved to different schemas
360         o Allow ALTER TABLESPACE to move to different directories
361         o Allow databases, schemas, and indexes to be moved to different 
362           tablespaces
363         o Allow moving system tables to other tablespaces, where possible
364
365         Currently non-global system tables must be in the default database
366         schema. Global system tables can never be moved.
367
368         o -Add ALTER DOMAIN, AGGREGATE, CONVERSION ... OWNER TO
369         o -Add ALTER SEQUENCE ... OWNER TO
370         o Add ALTER INDEX that works just like ALTER TABLE already does
371           on an index
372
373 * CLUSTER
374         o Automatically maintain clustering on a table
375
376         This would require some background daemon to restore clustering
377         during periods of low usage. It might also require tables to be only
378         paritally filled for easier reorganization.
379
380         o -Add ALTER TABLE table SET WITHOUT CLUSTER (Christopher)
381         o Add default clustering to system tables
382
383         To do this, determine the ideal cluster index for each system
384         table and set the cluster setting during initdb.
385
386 * COPY
387         o -Allow dump/load of CSV format
388         o Allow COPY to report error lines and continue
389         
390         This requires the use of a savepoint before each COPY line is
391         processed, with ROLLBACK on COPY failure.
392
393         o Allow COPY to understand \x as a hex byte
394         o Have COPY return the number of rows loaded/unloaded (?)
395
396 * CURSOR
397         o Allow UPDATE/DELETE WHERE CURRENT OF cursor
398         
399         This requires using the row ctid to map cursor rows back to the
400         original heap row. This become more complicated if WITH HOLD cursors
401         are to be supported because WITH HOLD cursors have a copy of the row
402         and no FOR UPDATE lock.
403
404         o Prevent DROP TABLE from dropping a row referenced by its own open
405           cursor (?)
406
407         o Allow pooled connections to list all open WITH HOLD cursors
408
409         Because WITH HOLD cursors exist outside transactions, this allows
410         them to be listed so they can be closed.
411
412 * INSERT
413         o Allow INSERT/UPDATE of the system-generated oid value for a row
414         o Allow INSERT INTO tab (col1, ..) VALUES (val1, ..), (val2, ..)
415         o Allow INSERT/UPDATE ... RETURNING new.col or old.col
416         
417         This is useful for returning the auto-generated key for an INSERT.
418         One complication is how to handle rules that run as part of
419         the insert.
420
421 * SHOW/SET
422         o Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
423           ANALYZE, and CLUSTER
424         o Add SET PATH for schemas (?)
425
426         This is basically the same as SET search_path.
427          
428         o Prevent conflicting SET options from being set
429
430         This requires a checking function to be called after the server
431         configuration file is read.
432
433 * SERVER-SIDE LANGUAGES
434         o Allow PL/PgSQL's RAISE function to take expressions (?)
435
436         Currently only constants are supported.
437
438         o Change PL/PgSQL to use palloc() instead of malloc()
439         o -Allow Java server-side programming
440         o Handle references to temporary tables that are created, destroyed, 
441           then recreated during a session, and EXECUTE is not used
442           
443         This requires the cached PL/PgSQL byte code to be invalidated when
444         an object referenced in the function is changed.
445
446     o Fix PL/pgSQL RENAME to work on variables other than OLD/NEW
447         o Improve PL/PgSQL exception handling using savepoints
448         o -Allow PL/pgSQL parameters to be specified by name and type during definition
449         o Allow function parameters to be passed by name,
450           get_employee_salary(emp_id => 12345, tax_year => 2001)
451         o Add Oracle-style packages
452         o Add table function support to pltcl, plperl, plpython (?)
453         o Allow PL/pgSQL to name columns by ordinal position, e.g. rec.(3)
454         o Allow PL/pgSQL EXECUTE query_var INTO record_var;
455         o Add capability to create and call PROCEDURES
456         o Allow PL/pgSQL to handle %TYPE arrays, e.g. tab.col%TYPE[]
457
458
459 Clients
460 =======
461
462 * Add XML output to pg_dump and COPY
463
464   We already allow XML to be stored in the database, and XPath queries
465   can be used on that data using /contrib/xml2. It also supports XSLT
466   transformations.
467     
468 * -Allow psql \du to show users, and add \dg for groups
469 * Add a libpq function to support Parse/DescribeStatement capability
470 * Prevent libpq's PQfnumber() from lowercasing the column name (?)
471 * -Allow pg_dump to dump CREATE CONVERSION (Christopher)
472 * -Make pg_restore continue after errors, so it acts more like pg_dump scripts
473 * Have psql show current values for a sequence
474 * Allow pg_dumpall to use non-text output formats
475 * Have pg_dump use multi-statement transactions for INSERT dumps
476 * Move psql backslash database information into the backend, use mnemonic
477   commands? [psql]
478
479   This would allow non-psql clients to pull the same information out of
480   the database as psql.
481
482 * Allow pg_dump to use multiple -t and -n switches
483
484   This should be done by allowing a '-t schema.table' syntax.
485
486 * Fix oid2name and dbsize for tablespaces
487 * Consistently display privilege information for all objects in psql
488
489 * ECPG (?)
490         o Docs
491
492         Document differences between ecpg and the SQL standard and
493         information about the Informix-compatibility module.
494
495         o -Implement SET DESCRIPTOR
496         o Solve cardinality > 1 for input descriptors / variables (?)
497         o Improve error handling (?)
498         o Add a semantic check level, e.g. check if a table really exists
499         o fix handling of DB attributes that are arrays
500         o Use backend PREPARE/EXECUTE facility for ecpg where possible
501         o Implement SQLDA
502         o Fix nested C comments
503         o sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified
504         o Make SET CONNECTION thread-aware, non-standard?
505         o Allow multidimensional arrays
506
507
508 Referential Integrity
509 =====================
510
511 * Add MATCH PARTIAL referential integrity
512 * Add deferred trigger queue file
513
514   Right now all deferred trigger information is stored in backend
515   memory.  This could exhaust memory for very large trigger queues.
516   This item involves dumping large queues into files.
517
518 * Implement dirty reads or shared row locks and use them in RI triggers (?)
519 * Enforce referential integrity for system tables
520 * Change foreign key constraint for array -> element to mean element
521   in array (?)
522 * Allow DEFERRABLE UNIQUE constraints (?)
523 * Allow triggers to be disabled [trigger]
524
525   Currently the only way to disable triggers is to modify the system
526   tables.
527
528 * With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
529
530   If the dump is known to be valid, allow foreign keys to be added
531   without revalidating the data.
532
533 * Allow statement-level triggers to access modified rows
534 * Support triggers on columns
535 * Have AFTER triggers execute after the appropriate SQL statement in a 
536   function, not at the end of the function
537 * -Print table names with constraint names in error messages, or make constraint
538   names unique within a schema
539 * -Issue NOTICE if foreign key data requires costly test to match primary key
540 * Remove CREATE CONSTRAINT TRIGGER
541
542   This was used in older releases to dump referential integrity
543   constraints.
544
545 * Allow AFTER triggers on system tables
546
547   System tables are modified in many places in the backend without going
548   through the executor and therefore not causing triggers to fire. To
549   complete this item, the functions that modify system tables will have
550   to fire triggers.
551
552
553 Dependency Checking
554 ===================
555
556 * Flush cached query plans when the dependent objects change
557 * -Use dependency information to dump data in proper order
558 * -Have pg_dump -c clear the database using dependency information
559 * Track dependencies in function bodies and recompile/invalidate
560
561
562 Exotic Features
563 ===============
564
565 * Add SQL99 WITH clause to SELECT
566 * Add SQL99 WITH RECURSIVE to SELECT
567 * Add pre-parsing phase that converts non-ANSI syntax to supported
568   syntax
569
570   This could allow SQL written for other databases to run without
571   modification.
572
573 * Allow plug-in modules to emulate features from other databases
574 * SQL*Net listener that makes PostgreSQL appear as an Oracle database
575   to clients
576 * Allow queries across databases or servers with transaction
577   semantics
578         
579   Right now contrib/dblink can be used to issue such queries except it
580   does not have locking or transaction semantics. Two-phase commit is
581   needed to enable transaction semantics.
582
583 * Add two-phase commit
584
585   This will involve adding a way to respond to commit failure by either
586   taking the server into offline/readonly mode or notifying the
587   administrator
588
589
590 PERFORMANCE
591 ===========
592
593
594 Fsync
595 =====
596
597 * Improve commit_delay handling to reduce fsync()
598 * Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
599 * Allow multiple blocks to be written to WAL with one write()
600 * Add an option to sync() before fsync()'ing checkpoint files
601
602
603 Cache
604 =====
605 * Add free-behind capability for large sequential scans [fadvise]
606 * Consider use of open/fcntl(O_DIRECT) to minimize OS caching
607 * Cache last known per-tuple offsets to speed long tuple access
608
609   While column offsets are already cached, the cache can not be used if
610   the tuple has NULLs or TOAST columns because these values change the
611   typical column offsets. Caching of such offsets could be accomplished
612   by remembering the previous offsets and use them again if the row has
613   the same pattern.
614
615 * Speed up COUNT(*)
616
617   We could use a fixed row count and a +/- count to follow MVCC
618   visibility rules, or a single cached value could be used and
619   invalidated if anyone modifies the table. [count]
620
621
622 Vacuum
623 ======
624
625 * Improve speed with indexes
626
627   For large table adjustements during vacuum, it is faster to reindex
628   rather than update the index.
629
630 * Reduce lock time by moving tuples with read lock, then write
631   lock and truncate table
632
633   Moved tuples are invisible to other backends so they don't require a
634   write lock. However, the read lock promotion to write lock could lead
635   to deadlock situations.
636
637 * -Provide automatic running of vacuum in the background in backend
638   rather than in /contrib (Matthew)
639 * Allow free space map to be auto-sized or warn when it is too small
640
641   The free space map is in shared memory so resizing is difficult.
642
643 * Maintain a map of recently-expired rows
644
645   This allows vacuum to reclaim free space without requiring
646   a sequential scan
647
648
649 Locking
650 =======
651
652 * Make locking of shared data structures more fine-grained
653
654   This requires that more locks be acquired but this would reduce lock
655   contention, improving concurrency.
656
657 * Add code to detect an SMP machine and handle spinlocks accordingly
658   from distributted.net, http://www1.distributed.net/source, 
659   in client/common/cpucheck.cpp
660
661   On SMP machines, it is possible that locks might be released shortly,
662   while on non-SMP machines, the backend should sleep so the process
663   holding the lock can complete and release it.
664
665 * Improve SMP performance on i386 machines
666
667   i386-based SMP machines can generate excessive context switching
668   caused by lock failure in high concurrency situations. This may be
669   caused by CPU cache line invalidation inefficiencies.
670
671 * Research use of sched_yield() for spinlock acquisition failure
672
673
674 Startup Time
675 ============
676
677 * Experiment with multi-threaded backend [thread]
678
679   This would prevent the overhead associated with process creation. Most
680   operating systems have trivial process creation time compared to
681   database startup overhead, but a few operating systems (WIn32,
682   Solaris) might benefit from threading.
683
684 * Add connection pooling [pool]
685
686   It is unclear if this should be done inside the backend code or done
687   by something external like pgpool. The passing of file descriptors to
688   existing backends is one of the difficulties with a backend approach.
689
690
691 Write-Ahead Log
692 ===============
693
694 * Eliminate need to write full pages to WAL before page modification [wal]
695
696   Currently, to protect against partial disk page writes, we write the
697   full page images to WAL before they are modified so we can correct any
698   partial page writes during recovery.
699
700 * Reduce WAL traffic so only modified values are written rather than
701   entire rows (?)
702 * Turn off after-change writes if fsync is disabled
703
704   If fsync is off, there is no purpose in writing full pages to WAL
705
706 * Add WAL index reliability improvement to non-btree indexes
707 * Allow the pg_xlog directory location to be specified during initdb
708   with a symlink back to the /data location
709
710 * Allow WAL information to recover corrupted pg_controldata
711 * Find a way to reduce rotational delay when repeatedly writing
712   last WAL page
713   
714   Currently fsync of WAL requires the disk platter to perform a full
715   rotation to fsync again. One idea is to write the WAL to different
716   offsets that might reduce the rotational delay.
717
718
719 Optimizer / Executor
720 ====================
721
722 * Add missing optimizer selectivities for date, r-tree, etc
723 * Allow ORDER BY ... LIMIT 1 to select high/low value without sort or
724   index using a sequential scan for highest/lowest values
725
726   If only one value is needed, there is no need to sort the entire
727   table. Instead a sequential scan could get the matching value.
728
729 * Precompile SQL functions to avoid overhead
730 * Add utility to compute accurate random_page_cost value
731 * Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
732 * Allow sorting, temp files, temp tables to use multiple work directories
733
734   This allows the I/O load to be spread across multiple disk drives.
735 * Have EXPLAIN ANALYZE highlight poor optimizer estimates
736 * Use CHECK constraints to influence optimizer decisions
737
738   CHECK constraints contain information about the distribution of values
739   within the table. This is also useful for implementing subtables where
740   a tables content is distributed across several subtables.
741
742
743 Miscellaneous
744 =============
745
746 * Do async I/O for faster random read-ahead of data
747
748   Async I/O allows multiple I/O requests to be sent to the disk with
749   results coming back asynchronously.
750     
751 * Use mmap() rather than SYSV shared memory or to write WAL files (?) [mmap]
752
753   This would remove the requirement for SYSV SHM but would introduce
754   portability issues. Anonymous mmap is required to prevent I/O
755   overhead.
756
757 * Add a script to ask system configuration questions and tune postgresql.conf
758 * -Use background process to write dirty shared buffers to disk
759 * Use a phantom command counter for nested subtransactions to reduce
760   tuple overhead
761
762
763 Source Code
764 ===========
765
766 * Add use of 'const' for variables in source tree
767 * Rename some /contrib modules from pg* to pg_*
768 * Move some things from /contrib into main tree
769 * Remove warnings created by -Wcast-align
770 * Move platform-specific ps status display info from ps_status.c to ports
771 * Improve access-permissions check on data directory in Cygwin (Tom)
772 * Add optional CRC checksum to heap and index pages
773 * -Change representation of whole-tuple parameters to functions
774 * Clarify use of 'application' and 'command' tags in SGML docs
775 * Better document ability to build only certain interfaces (Marc)
776 * Remove or relicense modules that are not under the BSD license, if possible
777 * Remove memory/file descriptor freeing before ereport(ERROR)
778 * Acquire lock on a relation before building a relcache entry for it
779 * Research interaction of setitimer() and sleep() used by statement_timeout
780 * -Add checks for fclose() failure (Tom)
781 * -Change CVS ID to PostgreSQL
782 * -Exit postmaster if postgresql.conf can not be opened
783 * Rename /scripts directory because they are all C programs now
784 * Promote debug_query_string into a server-side function current_query()
785 * Allow the identifier length to be increased via a configure option
786 * Allow binaries to be statically linked so they are more easily relocated
787
788
789 * Wire Protocol Changes
790         o Allow dynamic character set handling
791         o Add decoded type, length, precision
792         o Use compression?
793         o Update clients to use data types, typmod, schema.table.column names of
794           result sets using new query protocol
795
796
797 ---------------------------------------------------------------------------
798
799
800 Developers who have claimed items are:
801 --------------------------------------
802 * Alvaro is Alvaro Herrera <alvherre@dcc.uchile.cl>
803 * Andrew is Andrew Dunstan <andrew@dunslane.net>
804 * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
805 * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
806     Family Health Network
807 * Claudio is Claudio Natoli <claudio.natoli@memetrics.com>
808 * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
809 * Fabien is Fabien Coelho <coelho@cri.ensmp.fr>
810 * Gavin is Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
811 * Greg is Greg Sabino Mullane <greg@turnstep.com>
812 * Hiroshi is Hiroshi Inoue <Inoue@tpf.co.jp>
813 * Jan is Jan Wieck <JanWieck@Yahoo.com> of Afilias, Inc.
814 * Joe is Joe Conway <mail@joeconway.com>
815 * Karel is Karel Zak <zakkr@zf.jcu.cz>
816 * Kris is Kris Jurka 
817 * Magnus is Magnus Hagander <mha@sollentuna.net>
818 * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
819 * Matthew T. O'Connor <matthew@zeut.net>
820 * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
821 * Neil is Neil Conway <neilc@samurai.com>
822 * Oleg is Oleg Bartunov <oleg@sai.msu.su>
823 * Peter is Peter Eisentraut <peter_e@gmx.net>
824 * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
825 * Rod is Rod Taylor <pg@rbt.ca>
826 * Simon is Simon Riggs
827 * Stephan is Stephan Szabo <sszabo@megazone23.bigpanda.com>
828 * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
829 * Teodor is 
830 * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat