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