4 Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
5 Last updated: Wed Aug 24 10:00:31 EDT 2005
7 The most recent version of this document can be viewed at
8 http://www.postgresql.org/docs/faqs.TODO.html.
10 #A hyphen, "-", marks changes that will appear in the upcoming 8.1 release.#
12 Bracketed items, "[]", have more detail.
14 This list contains all known PostgreSQL bugs and feature requests. If
15 you would like to work on an item, please read the Developer's FAQ
22 * Remove behavior of postmaster -o after making postmaster/postgres
24 * -Allow limits on per-db/role connections
25 * Allow pooled connections to list all prepared queries
27 This would allow an application inheriting a pooled connection to know
28 the queries prepared in the current session.
30 * Allow major upgrades without dump/reload, perhaps using pg_upgrade
32 * Check for unreferenced table files created by transactions that were
33 in-progress when the server terminated abruptly
34 * Allow administrators to safely terminate individual sessions either
35 via an SQL function or SIGTERM
37 Currently SIGTERM of a backend can lead to lock table corruption.
39 * -Prevent dropping user that still owns objects, or auto-drop the objects
40 * Set proper permissions on non-system schemas during db creation
42 Currently all schemas are owned by the super-user because they are
43 copied from the template1 database.
45 * -Add the client IP address and port to pg_stat_activity
46 * Support table partitioning that allows a single table to be stored
47 in subtables that are partitioned based on the primary key or a WHERE
51 * Improve replication solutions
55 You can use any of the master/slave replication servers to use a
56 standby server for data warehousing. To allow read/write queries to
57 multiple servers, you need multi-master replication like pgcluster.
59 o Allow replication over unreliable or non-persistent links
64 o Add "include file" functionality in postgresql.conf
65 o Allow postgresql.conf values to be set so they can not be changed
67 o Allow commenting of variables in postgresql.conf to restore them
70 Currently, if a variable is commented out, it keeps the
71 previous uncommented value until a server restarted.
73 o Allow pg_hba.conf settings to be controlled via SQL
75 This would add a function to load the SQL table from
76 pg_hba.conf, and one to writes its contents to the flat file.
77 The table should have a line number that is a float so rows
78 can be inserted between existing rows, e.g. row 2.5 goes
79 between row 2 and row 3.
81 o Allow postgresql.conf file values to be changed via an SQL
82 API, perhaps using SET GLOBAL
83 o Allow the server to be stopped/restarted via an SQL API
88 * Allow a database in tablespace t1 with tables created in
89 tablespace t2 to be used as a template for a new database created
90 with default tablespace t2
92 All objects in the default database tablespace must have default
93 tablespace specifications. This is because new databases are
94 created by copying directories. If you mix default tablespace
95 tables and tablespace-specified tables in the same directory,
96 creating a new database from such a mixed directory would create a
97 new database with tables that had incorrect explicit tablespaces.
98 To fix this would require modifying pg_class in the newly copied
99 database, which we don't currently do.
101 * Allow reporting of which objects are in which tablespaces
103 This item is difficult because a tablespace can contain objects
104 from multiple databases. There is a server-side function that
105 returns the databases which use a specific tablespace, so this
106 requires a tool that will call that function and connect to each
107 database to find the objects in each database for that tablespace.
109 o Add a GUC variable to control the tablespace for temporary objects
112 It could start with a random tablespace from a supplied list and
113 cycle through the list.
115 o Allow WAL replay of CREATE TABLESPACE to work when the directory
116 structure on the recovery computer is different from the original
118 o Allow per-tablespace quotas
121 * Point-In-Time Recovery (PITR)
123 o Allow point-in-time recovery to archive partially filled
124 write-ahead logs [pitr]
126 Currently only full WAL files are archived. This means that the
127 most recent transactions aren't available for recovery in case
128 of a disk failure. This could be triggered by a user command or
131 o Automatically force archiving of partially-filled WAL files when
132 pg_stop_backup() is called or the server is stopped
134 Doing this will allow administrators to know more easily when
135 the archive contins all the files needed for point-in-time
138 o Create dump tool for write-ahead logs for use in determining
139 transaction id for point-in-time recovery
140 o Allow a warm standby system to also allow read-only queries
143 This is useful for checking PITR recovery.
145 o Allow the PITR process to be debugged and data examined
151 * Allow server log information to be output as INSERT statements
153 This would allow server log information to be easily loaded into
154 a database for analysis.
156 * Add ability to monitor the use of temporary sort files
157 * -Add session start time and last statement time to pg_stat_activity
158 * -Add a function that returns the start time of the postmaster
159 * Allow server logs to be remotely read and removed using SQL commands
165 * Remove Money type, add money formatting for decimal type
166 * Change NUMERIC to enforce the maximum precision, and increase it
167 * Add NUMERIC division operator that doesn't round?
169 Currently NUMERIC _rounds_ the result to the specified precision.
170 This means division can return a result that multiplied by the
171 divisor is greater than the dividend, e.g. this returns a value > 10:
173 SELECT (10::numeric(2,0) / 6::numeric(2,0))::numeric(2,0) * 6;
175 The positive modulus result returned by NUMERICs might be considered
176 inaccurate, in one sense.
178 * Have sequence dependency track use of DEFAULT sequences,
180 * Disallow changing default expression of a SERIAL column?
181 * Fix data types where equality comparison isn't intuitive, e.g. box
182 * Prevent INET cast to CIDR if the unmasked bits are not zero, or
184 * Prevent INET cast to CIDR from droping netmask, SELECT '1.1.1.1'::inet::cidr
185 * Allow INET + INT4 to increment the host part of the address, or
186 throw an error on overflow
187 * Add 'tid != tid ' operator for use in corruption recovery
192 o Allow infinite dates just like infinite timestamps
193 o Add a GUC variable to allow output of interval values in ISO8601
195 o Merge hardwired timezone names with the TZ database; allow either
196 kind everywhere a TZ name is currently taken
197 o Allow customization of the known set of TZ names (generalize the
198 present australian_timezones hack)
199 o Allow TIMESTAMP WITH TIME ZONE to store the original timezone
200 information, either zone name or offset from UTC [timezone]
202 If the TIMESTAMP value is stored with a time zone name, interval
203 computations should adjust based on the time zone rules.
205 o Add ISO INTERVAL handling
206 o Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO
208 o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
209 o For syntax that isn't uniquely ISO or PG syntax, like '1:30' or
210 '1', treat as ISO if there is a range specification clause,
211 and as PG if there no clause is present, e.g. interpret
212 '1:30' MINUTE TO SECOND as '1 minute 30 seconds', and
213 interpret '1:30' as '1 hour, 30 minutes'
214 o Interpret INTERVAL '1 year' MONTH as CAST (INTERVAL '1 year' AS
215 INTERVAL MONTH), and this should return '12 months'
216 o Round or truncate values to the requested precision, e.g.
217 INTERVAL '11 months' AS YEAR should return one or zero
218 o Support precision, CREATE TABLE foo (a INTERVAL MONTH(3))
223 o Allow NULLs in arrays
224 o Allow MIN()/MAX() on arrays
225 o Delay resolution of array expression's data type so assignment
226 coercion can be performed on empty array expressions
227 o Modify array literal representation to handle array index lower bound
233 o Improve vacuum of large objects, like /contrib/vacuumlo?
234 o Add security checking for large objects
236 Currently large objects entries do not have owners. Permissions can
237 only be set at the pg_largeobject table level.
239 o Auto-delete large objects when referencing row is deleted
240 o Allow read/write into TOAST values like large objects
242 This requires the TOAST column to be stored EXTERNAL.
248 * -Add function to return compressed length of TOAST data values
249 * Allow INET subnet tests using non-constants to be indexed
250 * Add transaction_timestamp(), statement_timestamp(), clock_timestamp()
253 Current CURRENT_TIMESTAMP returns the start time of the current
254 transaction, and gettimeofday() returns the wallclock time. This will
255 make time reporting more consistent and will allow reporting of
256 the statement start time.
258 * Add pg_get_acldef(), pg_get_typedefault(), and pg_get_attrdef()
259 * Allow to_char() to print localized month names
260 * Allow functions to have a schema search path specified at creation time
261 * Allow substring/replace() to get/set bit values
262 * Allow to_char() on interval values to accumulate the highest unit
265 Some special format flag would be required to request such
266 accumulation. Such functionality could also be added to EXTRACT.
267 Prevent accumulation that crosses the month/day boundary because of
268 the uneven number of days in a month.
270 o to_char(INTERVAL '1 hour 5 minutes', 'MI') => 65
271 o to_char(INTERVAL '43 hours 20 minutes', 'MI' ) => 2600
272 o to_char(INTERVAL '43 hours 20 minutes', 'WK:DD:HR:MI') => 0:1:19:20
273 o to_char(INTERVAL '3 years 5 months','MM') => 41
275 * -Prevent to_char() on interval from returning meaningless values
277 For example, to_char('1 month', 'mon') is meaningless. Basically,
278 most date-related parameters to to_char() are meaningless for
279 intervals because interval is not anchored to a date.
282 Multi-Language Support
283 ======================
285 * Add NCHAR (as distinguished from ordinary varchar),
286 * Allow locale to be set at database creation
288 Currently locale can only be set during initdb. No global tables have
289 locale-aware columns. However, the database template used during
290 database creation might have locale-aware indexes. The indexes would
291 need to be reindexed to match the new locale.
293 * Allow encoding on a per-column basis
295 Right now only one encoding is allowed per database.
297 * Support multiple simultaneous character sets, per SQL92
298 * Improve UTF8 combined character handling?
299 * Add octet_length_server() and octet_length_client()
300 * Make octet_length_client() the same as octet_length()?
301 * Fix problems with wrong runtime encoding conversion for NLS message files
307 * Automatically create rules on views so they are updateable, per SQL99
309 We can only auto-create rules for simple views. For more complex
310 cases users will still have to write rules.
312 * Add the functionality for WITH CHECK OPTION clause of CREATE VIEW
313 * Allow NOTIFY in rules involving conditionals
314 * Have views on temporary tables exist in the temporary namespace
315 * Allow temporary views on non-temporary tables
316 * Allow RULE recompilation
322 * -Add BETWEEN SYMMETRIC/ASYMMETRIC
323 * Change LIMIT/OFFSET and FETCH/MOVE to use int8
324 * -Add E'' escape string marker so eventually ordinary strings can treat
325 backslashes literally, for portability
327 * -Allow additional tables to be specified in DELETE for joins
329 UPDATE already allows this (UPDATE...FROM) but we need similar
330 functionality in DELETE. It's been agreed that the keyword should
331 be USING, to avoid anything as confusing as DELETE FROM a FROM b.
333 * Add CORRESPONDING BY to UNION/INTERSECT/EXCEPT
334 * -Allow REINDEX to rebuild all database indexes
335 * Add ROLLUP, CUBE, GROUPING SETS options to GROUP BY
336 * Allow SET CONSTRAINTS to be qualified by schema/table name
337 * Allow TRUNCATE ... CASCADE/RESTRICT
338 * Add a separate TRUNCATE permission
340 Currently only the owner can TRUNCATE a table because triggers are not
341 called, and the table is locked in exclusive mode.
343 * Allow PREPARE of cursors
344 * Allow PREPARE to automatically determine parameter types based on the SQL
346 * Allow finer control over the caching of prepared query plans
348 Currently, queries prepared via the libpq API are planned on first
349 execute using the supplied parameters --- allow SQL PREPARE to do the
350 same. Also, allow control over replanning prepared queries either
351 manually or automatically when statistics for execute parameters
352 differ dramatically from those used during planning.
354 * Allow LISTEN/NOTIFY to store info in memory rather than tables?
356 Currently LISTEN/NOTIFY information is stored in pg_listener. Storing
357 such information in memory would improve performance.
359 * Add optional textual message to NOTIFY
361 This would allow an informational message to be added to the notify
362 message, perhaps indicating the row modified or other custom
365 * Add a GUC variable to warn about non-standard SQL usage in queries
366 * Add MERGE command that does UPDATE/DELETE, or on failure, INSERT (rules,
368 * Add NOVICE output level for helpful messages like automatic sequence/index
370 * Add COMMENT ON for all cluster global objects (roles, databases
372 * -Add an option to automatically use savepoints for each statement in a
373 multi-statement transaction.
375 When enabled, this would allow errors in multi-statement transactions
376 to be automatically ignored.
378 * Make row-wise comparisons work per SQL spec
379 * Add RESET CONNECTION command to reset all session state
381 This would include resetting of all variables (RESET ALL), dropping of
382 temporary tables, removing any NOTIFYs, cursors, open transactions,
383 prepared queries, currval()s, etc. This could be used for connection
384 pooling. We could also change RESET ALL to have this functionality.
385 The difficult of this features is allowing RESET ALL to not affect
386 changes made by the interface driver for its internal use. One idea
387 is for this to be a protocol-only feature. Another approach is to
388 notify the protocol when a RESET CONNECTION command is used.
390 * Add GUC to issue notice about queries that use unjoined tables
391 * Allow EXPLAIN to identify tables that were skipped because of
393 * Allow EXPLAIN output to be more easily processed by scripts
398 o Allow CREATE TABLE AS to determine column lengths for complex
399 expressions like SELECT col1 || col2
401 o Use more reliable method for CREATE DATABASE to get a consistent
404 o Currently the system uses the operating system COPY command to
405 create a new database. Add ON COMMIT capability to CREATE TABLE AS
410 o Allow UPDATE to handle complex aggregates [update]?
411 o Allow an alias to be provided for the target table in
414 This is not SQL-spec but many DBMSs allow it.
416 o Allow UPDATE tab SET ROW (col, ...) = (...) for updating multiple
418 o -Allow FOR UPDATE queries to do NOWAIT locks
423 o Have ALTER TABLE RENAME rename SERIAL sequence names
424 o Add ALTER DOMAIN TYPE
425 o Allow ALTER TABLE ... ALTER CONSTRAINT ... RENAME
426 o Allow ALTER TABLE to change constraint deferrability and actions
427 o Disallow dropping of an inherited constraint
428 o -Allow objects to be moved to different schemas
429 o Allow ALTER TABLESPACE to move to different directories
430 o Allow databases to be moved to different tablespaces
431 o Allow moving system tables to other tablespaces, where possible
433 Currently non-global system tables must be in the default database
434 tablespace. Global system tables can never be moved.
436 o Prevent child tables from altering constraints like CHECK that were
437 inherited from the parent table
442 o Automatically maintain clustering on a table
444 This might require some background daemon to maintain clustering
445 during periods of low usage. It might also require tables to be only
446 paritally filled for easier reorganization. Another idea would
447 be to create a merged heap/index data file so an index lookup would
448 automatically access the heap data too. A third idea would be to
449 store heap rows in hashed groups, perhaps using a user-supplied
452 o Add default clustering to system tables
454 To do this, determine the ideal cluster index for each system
455 table and set the cluster setting during initdb.
460 o Allow COPY to report error lines and continue
462 This requires the use of a savepoint before each COPY line is
463 processed, with ROLLBACK on COPY failure.
465 o -Allow COPY to understand \x as a hex byte
466 o Have COPY return the number of rows loaded/unloaded?
467 o -Allow COPY to optionally include column headings in the first line
468 o -Allow COPY FROM ... CSV to interpret newlines and carriage
474 o Allow column-level privileges
475 o Allow GRANT/REVOKE permissions to be applied to all schema objects
478 The proposed syntax is:
479 GRANT SELECT ON ALL TABLES IN public TO phpuser;
480 GRANT SELECT ON NEW TABLES IN public TO phpuser;
482 * Allow GRANT/REVOKE permissions to be inherited by objects based on
488 o Allow UPDATE/DELETE WHERE CURRENT OF cursor
490 This requires using the row ctid to map cursor rows back to the
491 original heap row. This become more complicated if WITH HOLD cursors
492 are to be supported because WITH HOLD cursors have a copy of the row
493 and no FOR UPDATE lock.
495 o Prevent DROP TABLE from dropping a row referenced by its own open
498 o Allow pooled connections to list all open WITH HOLD cursors
500 Because WITH HOLD cursors exist outside transactions, this allows
501 them to be listed so they can be closed.
506 o Allow INSERT/UPDATE of the system-generated oid value for a row
507 o Allow INSERT INTO tab (col1, ..) VALUES (val1, ..), (val2, ..)
508 o Allow INSERT/UPDATE ... RETURNING new.col or old.col
510 This is useful for returning the auto-generated key for an INSERT.
511 One complication is how to handle rules that run as part of
517 o -Have SHOW ALL show descriptions for server-side variables
518 o Add SET PERFORMANCE_TIPS option to suggest INDEX, VACUUM, VACUUM
520 o Add SET PATH for schemas?
522 This is basically the same as SET search_path.
525 * Server-Side Languages
527 o -Allow PL/PgSQL's RAISE function to take expressions
529 Currently only constants are supported.
531 o -Change PL/PgSQL to use palloc() instead of malloc()
532 o Handle references to temporary tables that are created, destroyed,
533 then recreated during a session, and EXECUTE is not used
535 This requires the cached PL/PgSQL byte code to be invalidated when
536 an object referenced in the function is changed.
538 o Fix PL/pgSQL RENAME to work on variables other than OLD/NEW
539 o Allow function parameters to be passed by name,
540 get_employee_salary(emp_id => 12345, tax_year => 2001)
541 o Add Oracle-style packages
542 o Add table function support to pltcl, plperl, plpython?
543 o Allow PL/pgSQL to name columns by ordinal position, e.g. rec.(3)
544 o -Allow PL/pgSQL EXECUTE query_var INTO record_var;
545 o Add capability to create and call PROCEDURES
546 o Allow PL/pgSQL to handle %TYPE arrays, e.g. tab.col%TYPE[]
547 o Add MOVE to PL/pgSQL
548 o Pass arrays natively instead of as text between plperl and postgres
549 o Add support for polymorphic arguments and return types to plperl
555 * Add a libpq function to support Parse/DescribeStatement capability
556 * Prevent libpq's PQfnumber() from lowercasing the column name?
557 * Allow libpq to access SQLSTATE so pg_ctl can test for connection failure
559 This would be used for checking if the server is up.
561 * Add PQescapeIdentifier() to libpq
562 * Have initdb set DateStyle based on locale?
563 * Have pg_ctl look at PGHOST in case it is a socket directory?
564 * Add a schema option to createlang
565 * Allow pg_ctl to work properly with configuration files located outside
568 pg_ctl can not read the pid file because it isn't located in the
569 config directory but in the PGDATA directory. The solution is to
570 allow pg_ctl to read and understand postgresql.conf to find the
571 data_directory value.
576 o Have psql show current values for a sequence
577 o Move psql backslash database information into the backend, use
578 mnemonic commands? [psql]
580 This would allow non-psql clients to pull the same information out
581 of the database as psql.
583 o Fix psql's display of schema information (Neil)
584 o Allow psql \pset boolean variables to set to fixed values, rather
586 o Consistently display privilege information for all objects in psql
587 o Improve psql's handling of multi-line queries
592 o Have pg_dump use multi-statement transactions for INSERT dumps
593 o Allow pg_dump to use multiple -t and -n switches [pg_dump]
594 o Add dumping of comments on composite type columns
595 o Add dumping of comments on index columns
596 o Replace crude DELETE FROM method of pg_dumpall --clean for
597 cleaning of roles with separate DROP commands
598 o -Add dumping and restoring of LOB comments
599 o Stop dumping CASCADE on DROP TYPE commands in clean mode
600 o Add full object name to the tag field. eg. for operators we need
601 '=(integer, integer)', instead of just '='.
602 o Add pg_dumpall custom format dumps.
604 This is probably best done by combining pg_dump and pg_dumpall
605 into a single binary.
607 o Add CSV output format
608 o Update pg_dump and psql to use the new COPY libpq API (Christopher)
609 o Remove unnecessary abstractions in pg_dump source code
616 Document differences between ecpg and the SQL standard and
617 information about the Informix-compatibility module.
619 o Solve cardinality > 1 for input descriptors / variables?
620 o Add a semantic check level, e.g. check if a table really exists
621 o fix handling of DB attributes that are arrays
622 o Use backend PREPARE/EXECUTE facility for ecpg where possible
624 o Fix nested C comments
625 o sqlwarn[6] should be 'W' if the PRECISION or SCALE value specified
626 o Make SET CONNECTION thread-aware, non-standard?
627 o Allow multidimensional arrays
628 o Add internationalized message strings
631 Referential Integrity
632 =====================
634 * Add MATCH PARTIAL referential integrity
635 * Add deferred trigger queue file
637 Right now all deferred trigger information is stored in backend
638 memory. This could exhaust memory for very large trigger queues.
639 This item involves dumping large queues into files.
641 * -Implement shared row locks and use them in RI triggers
642 * Change foreign key constraint for array -> element to mean element
644 * Allow DEFERRABLE UNIQUE constraints?
645 * -Allow triggers to be disabled [trigger]
646 * Allow triggers to be disabled in only the current session.
648 This is currently possible by starting a multi-statement transaction,
649 modifying the system tables, performing the desired SQL, restoring the
650 system tables, and committing the transaction. ALTER TABLE ...
651 TRIGGER requires a table lock so it is not idea for this usage.
653 * With disabled triggers, allow pg_dump to use ALTER TABLE ADD FOREIGN KEY
655 If the dump is known to be valid, allow foreign keys to be added
656 without revalidating the data.
658 * Allow statement-level triggers to access modified rows
659 * Support triggers on columns (Greg Sabino Mullane)
660 * Remove CREATE CONSTRAINT TRIGGER
662 This was used in older releases to dump referential integrity
665 * Enforce referential integrity for system tables
666 * Allow AFTER triggers on system tables
668 System tables are modified in many places in the backend without going
669 through the executor and therefore not causing triggers to fire. To
670 complete this item, the functions that modify system tables will have
677 * Flush cached query plans when the dependent objects change
678 * Track dependencies in function bodies and recompile/invalidate
684 * Add SQL99 WITH clause to SELECT
685 * Add SQL99 WITH RECURSIVE to SELECT
686 * Add pre-parsing phase that converts non-ISO syntax to supported
689 This could allow SQL written for other databases to run without
692 * Allow plug-in modules to emulate features from other databases
693 * SQL*Net listener that makes PostgreSQL appear as an Oracle database
695 * Allow queries across databases or servers with transaction
698 This can be done using dblink and two-phase commit.
700 * -Add two-phase commit
703 * Add the features of packages
705 o Make private objects accessable only to objects in the same schema
706 o Allow current_schema.objname to access current schema objects
707 o Add session variables
708 o Allow nested schemas
714 * Allow inherited tables to inherit index, UNIQUE constraint, and primary
716 * UNIQUE INDEX on base column not honored on INSERTs/UPDATEs from
717 inherited table: INSERT INTO inherit_table (unique_index_col) VALUES
720 The main difficulty with this item is the problem of creating an index
721 that can span more than one table.
723 * Allow SELECT ... FOR UPDATE on inherited tables
724 * -Prevent inherited tables from expanding temporary subtables of other
726 * Add UNIQUE capability to non-btree indexes
727 * -Use indexes for MIN() and MAX()
729 MIN/MAX queries can already be rewritten as SELECT col FROM tab ORDER
730 BY col {DESC} LIMIT 1. Completing this item involves doing this
731 transformation automatically.
733 * -Use index to restrict rows returned by multi-key index when used with
734 non-consecutive keys to reduce heap accesses
736 For an index on col1,col2,col3, and a WHERE clause of col1 = 5 and
737 col3 = 9, spin though the index checking for col1 and col3 matches,
738 rather than just col1; also called skip-scanning.
740 * Prevent index uniqueness checks when UPDATE does not modify the column
742 Uniqueness (index) checks are done when updating a column even if the
743 column is not modified by the UPDATE.
745 * Fetch heap pages matching index entries in sequential order
747 Rather than randomly accessing heap pages based on index entries, mark
748 heap pages needing access in a bitmap and do the lookups in sequential
749 order. Another method would be to sort heap ctids matching the index
750 before accessing the heap rows.
752 * -Allow non-bitmap indexes to be combined by creating bitmaps in memory
754 This feature allows separate indexes to be ANDed or ORed together. This
755 is particularly useful for data warehousing applications that need to
756 query the database in an many permutations. This feature scans an index
757 and creates an in-memory bitmap, and allows that bitmap to be combined
758 with other bitmap created in a similar way. The bitmap can either index
759 all TIDs, or be lossy, meaning it records just page numbers and each
760 page tuple has to be checked for validity in a separate pass.
762 * Allow the creation of on-disk bitmap indexes which can be quickly
763 combined with other bitmap indexes
765 Such indexes could be more compact if there are only a few distinct values.
766 Such indexes can also be compressed. Keeping such indexes updated can be
769 * Allow use of indexes to search for NULLs
771 One solution is to create a partial index on an IS NULL expression.
773 * Allow accurate statistics to be collected on indexes with more than
774 one column or expression indexes, perhaps using per-index statistics
775 * Add fillfactor to control reserved free space during index creation
776 * Allow the creation of indexes with mixed ascending/descending specifiers
777 * -Fix incorrect rtree results due to wrong assumptions about "over"
779 * Allow constraint_exclusion to work for UNIONs like it does for
780 inheritance, and allow it to work for UPDATE and DELETE queries
785 o Add more GIST index support for geometric data types
786 o -Add concurrency to GIST
787 o Allow GIST indexes to create certain complex index types, like
788 digital trees (see Aoki)
792 o Pack hash index buckets onto disk pages more efficiently
794 Currently no only one hash bucket can be stored on a page. Ideally
795 several hash buckets could be stored on a single page and greater
796 granularity used for the hash algorithm.
798 o Consider sorting hash buckets so entries can be found using a
799 binary search, rather than a linear scan
801 o In hash indexes, consider storing the hash value with or instead
808 * Improve commit_delay handling to reduce fsync()
809 * Determine optimal fdatasync/fsync, O_SYNC/O_DSYNC options
810 * -Allow multiple blocks to be written to WAL with one write()
811 * Add an option to sync() before fsync()'ing checkpoint files
812 * Add program to test if fsync has a delay compared to non-fsync
818 * Allow free-behind capability for large sequential scans, perhaps using
821 Posix_fadvise() can control both sequential/random file caching and
822 free-behind behavior, but it is unclear how the setting affects other
823 backends that also have the file open, and the feature is not supported
824 on all operating systems.
826 * -Consider use of open/fcntl(O_DIRECT) to minimize OS caching,
829 O_DIRECT doesn't have the same media write guarantees as fsync, so it
830 is in addition to the fsync method, not in place of it.
832 * -Cache last known per-tuple offsets to speed long tuple access
835 We could use a fixed row count and a +/- count to follow MVCC
836 visibility rules, or a single cached value could be used and
837 invalidated if anyone modifies the table. Another idea is to
838 get a count directly from a unique index, but for this to be
839 faster than a sequential scan it must avoid access to the heap
840 to obtain tuple visibility information.
842 * Allow data to be pulled directly from indexes
844 Currently indexes do not have enough tuple visibility information
845 to allow data to be pulled from the index without also accessing
846 the heap. One way to allow this is to set a bit to index tuples
847 to indicate if a tuple is currently visible to all transactions
848 when the first valid heap lookup happens. This bit would have to
849 be cleared when a heap tuple is expired.
852 * Consider automatic caching of queries at various levels:
858 * -Allow the size of the buffer cache used by temporary objects to be
859 specified as a GUC variable
861 Larger local buffer cache sizes requires more efficient handling of
864 * Improve the background writer
866 Allow the background writer to more efficiently write dirty buffers
867 from the end of the LRU cache and use a clock sweep algorithm to
868 write other dirty buffers to reduced checkpoint I/O
870 * Allow sequential scans to take advantage of other concurrent
871 sequentiqal scans, also called "Synchronised Scanning"
873 One possible implementation is to start sequential scans from the lowest
874 numbered buffer in the shared cache, and when reaching the end wrap
875 around to the beginning, rather than always starting sequential scans
876 at the start of the table.
882 * Improve speed with indexes
884 For large table adjustements during vacuum, it is faster to reindex
885 rather than update the index.
887 * Reduce lock time by moving tuples with read lock, then write
888 lock and truncate table
890 Moved tuples are invisible to other backends so they don't require a
891 write lock. However, the read lock promotion to write lock could lead
892 to deadlock situations.
894 * -Add a warning when the free space map is too small
895 * Maintain a map of recently-expired rows
897 This allows vacuum to target specific pages for possible free space
898 without requiring a sequential scan.
900 * Auto-fill the free space map by scanning the buffer cache or by
901 checking pages written by the background writer
902 * Create a bitmap of pages that need vacuuming
904 Instead of sequentially scanning the entire table, have the background
905 writer or some other process record pages that have expired rows, then
906 VACUUM can look at just those pages rather than the entire table. In
907 the event of a system crash, the bitmap would probably be invalidated.
909 * Add system view to show free space map contents
914 o -Move into the backend code
915 o Use free-space map information to guide refilling
916 o Suggest VACUUM FULL if a table is nearly empty
917 o Improve xid wraparound detection by recording per-table rather
924 * -Make locking of shared data structures more fine-grained
926 This requires that more locks be acquired but this would reduce lock
927 contention, improving concurrency.
929 * Add code to detect an SMP machine and handle spinlocks accordingly
930 from distributted.net, http://www1.distributed.net/source,
931 in client/common/cpucheck.cpp
933 On SMP machines, it is possible that locks might be released shortly,
934 while on non-SMP machines, the backend should sleep so the process
935 holding the lock can complete and release it.
937 * -Improve SMP performance on i386 machines
939 i386-based SMP machines can generate excessive context switching
940 caused by lock failure in high concurrency situations. This may be
941 caused by CPU cache line invalidation inefficiencies.
943 * Research use of sched_yield() for spinlock acquisition failure
944 * Fix priority ordering of read and write light-weight locks (Neil)
947 Startup Time Improvements
948 =========================
950 * Experiment with multi-threaded backend [thread]
952 This would prevent the overhead associated with process creation. Most
953 operating systems have trivial process creation time compared to
954 database startup overhead, but a few operating systems (WIn32,
955 Solaris) might benefit from threading. Also explore the idea of
956 a single session using multiple threads to execute a query faster.
958 * Add connection pooling
960 It is unclear if this should be done inside the backend code or done
961 by something external like pgpool. The passing of file descriptors to
962 existing backends is one of the difficulties with a backend approach.
968 * Eliminate need to write full pages to WAL before page modification [wal]
970 Currently, to protect against partial disk page writes, we write
971 full page images to WAL before they are modified so we can correct any
972 partial page writes during recovery. These pages can also be
973 eliminated from point-in-time archive files.
975 o -Add ability to turn off full page writes
976 o When off, write CRC to WAL and check file system blocks
979 If CRC check fails during recovery, remember the page in case
980 a later CRC for that page properly matches.
982 o Write full pages during file system write and not when
983 the page is modified in the buffer cache
985 This allows most full page writes to happen in the background
986 writer. It might cause problems for applying WAL on recovery
987 into a partially-written page, but later the full page will be
990 * Reduce WAL traffic so only modified values are written rather than
992 * Add WAL index reliability improvement to non-btree indexes
993 * Allow the pg_xlog directory location to be specified during initdb
994 with a symlink back to the /data location
995 * Allow WAL information to recover corrupted pg_controldata
996 * Find a way to reduce rotational delay when repeatedly writing
999 Currently fsync of WAL requires the disk platter to perform a full
1000 rotation to fsync again. One idea is to write the WAL to different
1001 offsets that might reduce the rotational delay.
1003 * Allow buffered WAL writes and fsync
1005 Instead of guaranteeing recovery of all committed transactions, this
1006 would provide improved performance by delaying WAL writes and fsync
1007 so an abrupt operating system restart might lose a few seconds of
1008 committed transactions but still be consistent. We could perhaps
1009 remove the 'fsync' parameter (which results in an an inconsistent
1010 database) in favor of this capability.
1012 * -Eliminate WAL logging for CREATE TABLE AS when not doing WAL archiving
1013 * -Change WAL to use 32-bit CRC, for performance reasons
1016 Optimizer / Executor
1017 ====================
1019 * Add missing optimizer selectivities for date, r-tree, etc
1020 * Allow ORDER BY ... LIMIT # to select high/low value without sort or
1021 index using a sequential scan for highest/lowest values
1023 Right now, if no index exists, ORDER BY ... LIMIT # requires we sort
1024 all values to return the high/low value. Instead The idea is to do a
1025 sequential scan to find the high/low value, thus avoiding the sort.
1026 MIN/MAX already does this, but not for LIMIT > 1.
1028 * Precompile SQL functions to avoid overhead
1029 * Create utility to compute accurate random_page_cost value
1030 * Improve ability to display optimizer analysis using OPTIMIZER_DEBUG
1031 * Have EXPLAIN ANALYZE highlight poor optimizer estimates
1032 * -Use CHECK constraints to influence optimizer decisions
1034 CHECK constraints contain information about the distribution of values
1035 within the table. This is also useful for implementing subtables where
1036 a tables content is distributed across several subtables.
1038 * Consider using hash buckets to do DISTINCT, rather than sorting
1040 This would be beneficial when there are few distinct values.
1042 * ANALYZE should record a pg_statistic entry for an all-NULL column
1043 * Log queries where the optimizer row estimates were dramatically
1044 different from the number of rows actually found?
1047 Miscellaneous Performance
1048 =========================
1050 * Do async I/O for faster random read-ahead of data
1052 Async I/O allows multiple I/O requests to be sent to the disk with
1053 results coming back asynchronously.
1055 * Use mmap() rather than SYSV shared memory or to write WAL files?
1057 This would remove the requirement for SYSV SHM but would introduce
1058 portability issues. Anonymous mmap (or mmap to /dev/zero) is required
1059 to prevent I/O overhead.
1061 * Consider mmap()'ing files into a backend?
1063 Doing I/O to large tables would consume a lot of address space or
1064 require frequent mapping/unmapping. Extending the file also causes
1065 mapping problems that might require mapping only individual pages,
1066 leading to thousands of mappings. Another problem is that there is no
1067 way to _prevent_ I/O to disk from the dirty shared buffers so changes
1068 could hit disk before WAL is written.
1070 * Add a script to ask system configuration questions and tune postgresql.conf
1071 * Use a phantom command counter for nested subtransactions to reduce
1073 * Research storing disk pages with no alignment/padding
1078 * Add use of 'const' for variables in source tree
1079 * Rename some /contrib modules from pg* to pg_*
1080 * Move some things from /contrib into main tree
1081 * Move some /contrib modules out to their own project sites
1082 * Remove warnings created by -Wcast-align
1083 * Move platform-specific ps status display info from ps_status.c to ports
1084 * Add optional CRC checksum to heap and index pages
1085 * Improve documentation to build only interfaces (Marc)
1086 * Remove or relicense modules that are not under the BSD license, if possible
1087 * Remove memory/file descriptor freeing before ereport(ERROR)
1088 * Acquire lock on a relation before building a relcache entry for it
1089 * Promote debug_query_string into a server-side function current_query()
1090 * Allow the identifier length to be increased via a configure option
1091 * Remove Win32 rename/unlink looping if unnecessary
1092 * -Remove kerberos4 from source tree
1093 * Allow cross-compiling by generating the zic database on the target system
1094 * Improve NLS maintenace of libpgport messages linked onto applications
1095 * Allow ecpg to work with MSVC and BCC
1096 * -Make src/port/snprintf.c thread-safe
1097 * Add xpath_array() to /contrib/xml2 to return results as an array
1098 * Allow building in directories containing spaces
1100 This is probably not possible because 'gmake' and other compiler tools
1101 do not fully support quoting of paths with spaces.
1103 * Allow installing to directories containing spaces
1105 This is possible if proper quoting is added to the makefiles for the
1106 install targets. Because PostgreSQL supports relocatable installs, it
1107 is already possible to install into a directory that doesn't contain
1108 spaces and then copy the install to a directory with spaces.
1110 * Fix cross-compiling of time zone database via 'zic'
1111 * Fix sgmltools so PDFs can be generated with bookmarks
1112 * -Add C code on Unix to copy directories for use in creating new databases
1117 o Remove configure.in check for link failure when cause is found
1118 o Remove readdir() errno patch when runtime/mingwex/dirent.c rev
1120 o Remove psql newline patch when we find out why mingw outputs an
1122 o Allow psql to use readline once non-US code pages work with
1124 o Re-enable timezone output on log_line_prefix '%t' when a
1125 shorter timezone string is available
1126 o Improve dlerror() reporting string
1127 o Fix problem with shared memory on the Win32 Terminal Server
1128 o Add support for Unicode
1130 To fix this, the data needs to be converted to/from UTF16/UTF8
1131 so the Win32 wcscoll() can be used, and perhaps other functions
1132 like towupper(). However, UTF8 already works with normal
1133 locales but provides no ordering or character set classes.
1136 * Wire Protocol Changes
1138 o Allow dynamic character set handling
1139 o Add decoded type, length, precision
1141 o Update clients to use data types, typmod, schema.table.column names
1142 of result sets using new query protocol
1145 ---------------------------------------------------------------------------
1148 Developers who have claimed items are:
1149 --------------------------------------
1150 * Alvaro is Alvaro Herrera <alvherre@dcc.uchile.cl>
1151 * Andrew is Andrew Dunstan <andrew@dunslane.net>
1152 * Bruce is Bruce Momjian <pgman@candle.pha.pa.us> of Software Research Assoc.
1153 * Christopher is Christopher Kings-Lynne <chriskl@familyhealth.com.au> of
1154 Family Health Network
1155 * Claudio is Claudio Natoli <claudio.natoli@memetrics.com>
1156 * D'Arcy is D'Arcy J.M. Cain <darcy@druid.net> of The Cain Gang Ltd.
1157 * Fabien is Fabien Coelho <coelho@cri.ensmp.fr>
1158 * Gavin is Gavin Sherry <swm@linuxworld.com.au> of Alcove Systems Engineering
1159 * Greg is Greg Sabino Mullane <greg@turnstep.com>
1160 * Hiroshi is Hiroshi Inoue <Inoue@tpf.co.jp>
1161 * Jan is Jan Wieck <JanWieck@Yahoo.com> of Afilias, Inc.
1162 * Joe is Joe Conway <mail@joeconway.com>
1163 * Karel is Karel Zak <zakkr@zf.jcu.cz>
1164 * Magnus is Magnus Hagander <mha@sollentuna.net>
1165 * Marc is Marc Fournier <scrappy@hub.org> of PostgreSQL, Inc.
1166 * Matthew T. O'Connor <matthew@zeut.net>
1167 * Michael is Michael Meskes <meskes@postgresql.org> of Credativ
1168 * Neil is Neil Conway <neilc@samurai.com>
1169 * Oleg is Oleg Bartunov <oleg@sai.msu.su>
1170 * Peter is Peter Eisentraut <peter_e@gmx.net>
1171 * Philip is Philip Warner <pjw@rhyme.com.au> of Albatross Consulting Pty. Ltd.
1172 * Rod is Rod Taylor <pg@rbt.ca>
1173 * Simon is Simon Riggs <simon@2ndquadrant.com>
1174 * Stephan is Stephan Szabo <sszabo@megazone23.bigpanda.com>
1175 * Tatsuo is Tatsuo Ishii <t-ishii@sra.co.jp> of Software Research Assoc.
1176 * Tom is Tom Lane <tgl@sss.pgh.pa.us> of Red Hat