Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Hackers

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-12-2008, 06:34 AM
Joshua D. Drake
 
Posts: n/a
Default 10 weeks to feature freeze (Pending Work)

Or so...

Thought I would do a poll of what is happening in the world for 8.3. I have:

Alvaro Herrera: Autovacuum improvements (maintenance window etc..)
Gavin Sherry: Bitmap Indexes (on disk), possible basic Window functions
Jonah Harris: WITH/Recursive Queries?
Andrei Kovalesvki: Some Win32 work with Magnus
Magnus Hagander: VC++ support (thank goodness)
Heikki Linnakangas: Working on Vacuum for Bitmap Indexes?
Oleg Bartunov: Tsearch2 in core
Neil Conway: Patch Review (including enums), pg_fcache

Vertical projects:

Pavel Stehule: PLpsm
Alexey Klyukin: PLphp
Andrei Kovalesvki: ODBCng

I am sure there are more, the ones with question marks are unknowns but
heard of in the ether somewhere. Any additions or confirmations?

Sincerely,

Joshua D. Drake



--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-12-2008, 06:34 AM
Jonah H. Harris
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)

On 1/22/07, Joshua D. Drake <jd@commandprompt.com> wrote:
> Jonah Harris: WITH/Recursive Queries?


Yup, just talked with Bruce about this last week. Working on the design now.

--
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation | fax: 732.331.1301
33 Wood Ave S, 3rd Floor | jharris@enterprisedb.com
Iselin, New Jersey 08830 | http://www.enterprisedb.com/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-12-2008, 06:34 AM
Oleg Bartunov
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)

On Mon, 22 Jan 2007, Joshua D. Drake wrote:

> Or so...
>
> Thought I would do a poll of what is happening in the world for 8.3. I have:
>
> Alvaro Herrera: Autovacuum improvements (maintenance window etc..)
> Gavin Sherry: Bitmap Indexes (on disk), possible basic Window functions
> Jonah Harris: WITH/Recursive Queries?
> Andrei Kovalesvki: Some Win32 work with Magnus
> Magnus Hagander: VC++ support (thank goodness)
> Heikki Linnakangas: Working on Vacuum for Bitmap Indexes?
> Oleg Bartunov: Tsearch2 in core


Teodor Sigaev should be here !

> Neil Conway: Patch Review (including enums), pg_fcache
>
> Vertical projects:
>
> Pavel Stehule: PLpsm
> Alexey Klyukin: PLphp
> Andrei Kovalesvki: ODBCng
>
> I am sure there are more, the ones with question marks are unknowns but
> heard of in the ether somewhere. Any additions or confirmations?
>
> Sincerely,
>
> Joshua D. Drake
>
>
>
>


Regards,
Oleg
__________________________________________________ ___________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-12-2008, 06:34 AM
korryd@enterprisedb.com
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)



> Thought I would do a poll of what is happening in the world for 8.3. I have:
>
> Alvaro Herrera: Autovacuum improvements (maintenance window etc..)
> Gavin Sherry: Bitmap Indexes (on disk), possible basic Window functions
> Jonah Harris: WITH/Recursive Queries?
> Andrei Kovalesvki: Some Win32 work with Magnus
> Magnus Hagander: VC++ support (thank goodness)
> Heikki Linnakangas: Working on Vacuum for Bitmap Indexes?
> Oleg Bartunov: Tsearch2 in core
> Neil Conway: Patch Review (including enums), pg_fcache




Korry Douglas: PL/pgSQL debugger (and probably a PL/pgSQL execution profiler as well)




--
Korry Douglas korryd@enterprisedb.com
EnterpriseDB http://www.enterprisedb.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-12-2008, 06:34 AM
Jeff Davis
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)

On Mon, 2007-01-22 at 14:16 -0800, Joshua D. Drake wrote:
> I am sure there are more, the ones with question marks are unknowns but
> heard of in the ether somewhere. Any additions or confirmations?
>


I'd still like to make an attempt at my Synchronized Scanning patch.

If freeze is 10 weeks away, I better get some more test results posted
soon, however.

Regards,
Jeff Davis


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-12-2008, 06:34 AM
ITAGAKI Takahiro
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)


"Joshua D. Drake" <jd@commandprompt.com> wrote:

> Thought I would do a poll of what is happening in the world for 8.3. I have:
>
> Alvaro Herrera: Autovacuum improvements (maintenance window etc..)
> Gavin Sherry: Bitmap Indexes (on disk), possible basic Window functions
> Jonah Harris: WITH/Recursive Queries?
> Andrei Kovalesvki: Some Win32 work with Magnus
> Magnus Hagander: VC++ support (thank goodness)
> Heikki Linnakangas: Working on Vacuum for Bitmap Indexes?
> Oleg Bartunov: Tsearch2 in core
> Neil Conway: Patch Review (including enums), pg_fcache


I'm working on Dead Space Map and Load-distribution of checkpoints.
I will make it do by 8.3.

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center



---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-12-2008, 06:34 AM
Stephen Frost
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)

* Joshua D. Drake (jd@commandprompt.com) wrote:
> Thought I would do a poll of what is happening in the world for 8.3. I have:


It seems unlikely that I'm going to have time at the rate things are
going but I was hoping to take a whack at default permissions/ownership
by schema. Kind of a umask-type thing but for schemas instead of roles
(though I've thought about it per role and that might also solve the
particular problem we're having atm).

Thanks,

Stephen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFtW7nrzgMPqB3kigRAoFVAKCYt4iCIjRDESs1Qxu5y3 KAMn6c/ACgl4qf
DJHtbevMGkUHoktgN1rdSX4=
=zIhO
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-12-2008, 06:34 AM
Stephen Frost
 
Posts: n/a
Default Re: 10 weeks to feature freeze (Pending Work)

* Joshua D. Drake (jd@commandprompt.com) wrote:
> Thought I would do a poll of what is happening in the world for 8.3. I have:


Another thing which was mentioned previously which I'd really like to
see happen (and was discussed on the list...) is replacing the Kerberos
support with GSSAPI support and adding support for SSPI. Don't recall
who had said they were looking into working on it though..

Thanks,

Stephen

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFtW9przgMPqB3kigRAnrcAJ9txQONuB7YwK4pJ61Yvh +Zviib/ACgl9FV
HEV30eP5n9y0UFDI/i7+LR8=
=XTbk
-----END PGP SIGNATURE-----

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-12-2008, 06:34 AM
FAST PostgreSQL
 
Posts: n/a
Default Updateable cursors

We are trying to develop the updateable cursors functionality into
Postgresql. I have given below details of the design and also issues we are
facing. Looking forward to the advice on how to proceed with these issues.

Rgds,
Arul Shaji





1. Introduction
--------------
This is a combined proposal and design document for adding updatable
(insensitive) cursor capability to the PostgreSQL database.
There have already been a couple of previous proposals since 2003 for
implementing this feature so there appears to be community interest in doing
so. This will enable the following constructs to be processed:


UPDATE <table_name> SET value_list WHERE CURRENT OF <cursor_name>
DELETE FROM <table_name> WHERE CURRENT OF <cursor_name>

This has the effect of users being able to update or delete specific rows of
a table, as defined by the row currently fetched into the cursor.


2. Overall Conceptual Design
-----------------------------
The design is considered from the viewpoint of progression of a command
through the various stages of processing, from changes to the file ‘gram.y’
to implement the actual grammar changes, through to changes in the Executor
portion of the database architecture.

2.1 Changes to the Grammar
------------------------------
The following changes will be done to the PostgreSQL grammar:

UPDATE statement has the option ‘WHERE CURRENT OF <cursor_name>’ added
DELETE statement has the option ‘WHERE CURRENT OF <cursor_name>’ added

The cursor_name data is held in the UpdateStmt and DeleteStmt structures and
contains just the name of the cursor.

The pl/pgsql grammar changes in the same manner.

The word CURRENT will be added to the ScanKeywords array in keywords.c.


2.2 Changes to Affected Data Structures
------------------------------------------
The following data structures are affected by this change:

Portal structure, QueryDesc structure, the UpdateStmt and DeleteStmt
structures

The Portal will contain a list of structures of relation ids and tuple ids
relating to the tuple held in the QueryDesc structure. There will be one
entry in the relation and tuple id list for each entry in the relation-list
of the statement below:

DECLARE <cursor_name> [WITH HOLD] SELECT FOR UPDATE OF <relation-list>

The QueryDesc structure will contain the relation id and the tuple id
relating to the tuple obtained via the FETCH command so that it can be
propagated back to the Portal for storage in the list described above.

The UpdateStmt and DeleteStmt structures have the cursor name added so that
the information is available for use in obtaining the portal structure
related to the cursor previously opened via the DECLARE CURSOR request.


2.3 Changes to the SQL Parser
------------------------------------
At present, although the FOR UPDATE clause of the DECLARE CURSOR command has
been present in the grammar, it causes an error message later in the
processing since cursors are currently not updatable. This now needs to
change. The ‘FOR UPDATE’ clause has to be valid, but not the ‘FOR SHARE’
clause.

The relation names that follow the ‘FOR UPDATE’ clause will be added to the
rtable in the Query structure and identified by means of the rowMarks array.
In the case of an updatable cursor the FOR SHARE option is not allowed
therefore all entries in the rtable that are identified by the rowMarks array
must relate to tables that are FOR UPDATE.

In the UPDATE or DELETE statements the ‘WHERE CURRENT OF <cursor_name>’
clause results in the cursor name being placed in the UpdateStmt or
DeleteStmt structure. During the processing of the functions -
transformDeleteStmt() and transformUpdateStmt() - the cursor name is used to
obtain a pointer to the related Portal structure and the tuple affected by
the current UPDATE or DELETE statement is extracted from the Portal, where it
has been placed as the result of a previous FETCH request. At this point all
the information for the UPDATE or DELETE statement is available so the
statements can be transformed into standard UPDATE or DELETE statements and
sent for re-write/planning/execution as usual.

2.4 Changes to the Optimizer
------------------------------
There is a need to add a TidScan node to planning UPDATE / DELETE statements
where the statements are ‘UPDATE / DELETE at position’. This is to enable the
tuple ids of the tuples in the tables relating to the query to be obtained.
There will need to be a new mechanism to achieve this, as at present, a Tid
scan is done only if there is a standard WHERE condition on update or delete
statements to provide Tid qualifier data.


2.5 Changes to the Executor
-------------------------------
There are various options that have been considered for this part of the
enhancement. These are described in the sections below.

We would like to hear opinions on which option is the best way to go or if
none of these is acceptable, any alternate ideas ?

Option 1 MVCC Via Continuous Searching of Database

The Executor is to be changed in the following ways:
1) When the FETCH statement is executed the id of the resulting tuple is
extracted and passed back to the Portal structure to be saved to indicate the
cursor is currently positioned on a tuple.
2) When the UPDATE or DELETE request is executed the tuple id previously
FETCHed is held in the QueryDesc structure so that it can be compared with
the tuple ids returned from the TidScan node processed prior to the actual
UPDATE / DELETE node in the plan. This enables a decision to be made as to
whether the tuple held in the cursor is visible to the UPDATE / DELETE
request according to the rules of concurrency. The result is that, at the
cost of repeatedly searching the database at each UPDATE / DELETE command,
the hash table is no longer required.
This approach has the advantage that there is no hash table held in memory or
on disk so it will not be memory intensive but will be processing intensive.

This is a good ‘one-off’ solution to the problem and, taken in isolation is
probably the best approach. However, if one considers the method(s) used in
other areas of PostgreSQL, it is probably not the best solution. This option
will probably not be used further.

Option 2 MVCC via New Snapshot

The executor can be changed by adding a new kind of snapshot that is
specifically used for identifying if a given tuple, retrieved from the
database during an update or delete statement should be visible during the
current transaction.

This approach requires a new kind of snapshot (this idea was used by Gavin
for a previous updatable cursor patch but objections were raised.)

Option 3 MVCC Via Hash Table in Memory

The executor can be changed by saving into a hash table and comparing each
tuple in the cursor with that set to check if the tuple should be visible.
This approach has the advantage that it will be quick. It has the
disadvantage that, since the hash table will contain all the tuples of the
table being checked that it may use all local memory for a large table.

Option 4 MVCC Via Hash Table on Disk

When the UPDATE or DELETE request is executed the first time the Tid scan
database retrieval will be done first. At this time the tuple id of each row
in the table to be updated by the request will be available in the executor.
These tuple ids need to be stored in a hash table that is stored to disk, as,
if the table is large there could be a huge number of tuple ids. This data is
then available for comparison with the individual tuple to be updated or
deleted to check if it should be processed. The hash table will exist for the
duration of the transaction, from BEGIN to END (or ABORT).

The hash table is then used to identify if the tuple should be visible during
the current transaction. If the tuple should be visible then the update or
delete proceeds as usual.

This approach has the advantage that it will use little memory but will be
relatively slow as the data has to be accessed from disk.

Option 5 Store Tuple Id in Snapshot.

The Snapshot structure can be changed to include the tuple id. This enables
the current state of the tuple to be identified with respect to the current
transaction.
The tuple id, as identified in the cursor at the point where the
DELETE/UPDATE statement is being processed, can use the snapshot to identify
if the tuple should be visible in the context of the current transaction.


2.6 Changes to the Catalog
----------------------------
The Catalog needs to reflect changes introduced by the updatable cursor
implementation. A boolean attribute ‘is_for_update’ is to be added to the
pg_cursors implementation. It will define that the cursor is for update
(value is FALSE) or for share (value is TRUE, the default value).


3 Design Assumptions
----------------------------
The following design assumptions are made:

As PostgreSQL8.2 does not support the SENSITIVE cursor option the tuples
contained in a cursor can never be updated so these tuples will always appear
in their ‘original’ form as at the start of the transaction. This is in
breach of the SQL2003 Standard as described in 5WD-02-Foundation-2003-09.pdf,
p 810. The standard requires the updatable cursor to be declared as sensitive.

With respect to nested transactions – In PostgreSQL nested transactions are
implemented by defining ‘save points’ via the keyword SAVEPOINT. A ‘ROLLBACK
TO SAVEPOINT’ rolls back the database contents to the last savepoint in this
transaction or the begin statement, whichever is closer.

It is assumed that the FETCH statement is used to return only a single row
into the cursor with each command when the cursor is updatable.

According to the SQL2003 Standard Update and Delete statements may contain
only a single base table.

The DECLARE CURSOR statement is supposed to use column level locking, but
PostgreSQL supports only row level locking. The result of this is that the
column list that the standard requires ‘DECLARE <cursor_name> SELECT … FOR
UPDATE OF column-list’ becomes a relation (table) list.

This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.

If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fujitsu.com.au


---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-12-2008, 06:34 AM
Joshua D. Drake
 
Posts: n/a
Default Re: Updateable cursors

FAST PostgreSQL wrote:
> We are trying to develop the updateable cursors functionality into
> Postgresql. I have given below details of the design and also issues we are
> facing. Looking forward to the advice on how to proceed with these issues.
>
> Rgds,
> Arul Shaji


Would this be something that you would hope to submit for 8.3?

Joshua D. Drake


>
>
>
>
>
> 1. Introduction
> --------------
> This is a combined proposal and design document for adding updatable
> (insensitive) cursor capability to the PostgreSQL database.
> There have already been a couple of previous proposals since 2003 for
> implementing this feature so there appears to be community interest in doing
> so. This will enable the following constructs to be processed:
>
>
> UPDATE <table_name> SET value_list WHERE CURRENT OF <cursor_name>
> DELETE FROM <table_name> WHERE CURRENT OF <cursor_name>
>
> This has the effect of users being able to update or delete specific rows of
> a table, as defined by the row currently fetched into the cursor.
>
>
> 2. Overall Conceptual Design
> -----------------------------
> The design is considered from the viewpoint of progression of a command
> through the various stages of processing, from changes to the file ‘gram.y’
> to implement the actual grammar changes, through to changes in the Executor
> portion of the database architecture.
>
> 2.1 Changes to the Grammar
> ------------------------------
> The following changes will be done to the PostgreSQL grammar:
>
> UPDATE statement has the option ‘WHERE CURRENT OF <cursor_name>’ added
> DELETE statement has the option ‘WHERE CURRENT OF <cursor_name>’ added
>
> The cursor_name data is held in the UpdateStmt and DeleteStmt structures and
> contains just the name of the cursor.
>
> The pl/pgsql grammar changes in the same manner.
>
> The word CURRENT will be added to the ScanKeywords array in keywords.c.
>
>
> 2.2 Changes to Affected Data Structures
> ------------------------------------------
> The following data structures are affected by this change:
>
> Portal structure, QueryDesc structure, the UpdateStmt and DeleteStmt
> structures
>
> The Portal will contain a list of structures of relation ids and tuple ids
> relating to the tuple held in the QueryDesc structure. There will be one
> entry in the relation and tuple id list for each entry in the relation-list
> of the statement below:
>
> DECLARE <cursor_name> [WITH HOLD] SELECT FOR UPDATE OF <relation-list>
>
> The QueryDesc structure will contain the relation id and the tuple id
> relating to the tuple obtained via the FETCH command so that it can be
> propagated back to the Portal for storage in the list described above.
>
> The UpdateStmt and DeleteStmt structures have the cursor name added so that
> the information is available for use in obtaining the portal structure
> related to the cursor previously opened via the DECLARE CURSOR request.
>
>
> 2.3 Changes to the SQL Parser
> ------------------------------------
> At present, although the FOR UPDATE clause of the DECLARE CURSOR command has
> been present in the grammar, it causes an error message later in the
> processing since cursors are currently not updatable. This now needs to
> change. The ‘FOR UPDATE’ clause has to be valid, but not the ‘FOR SHARE’
> clause.
>
> The relation names that follow the ‘FOR UPDATE’ clause will be added to the
> rtable in the Query structure and identified by means of the rowMarks array.
> In the case of an updatable cursor the FOR SHARE option is not allowed
> therefore all entries in the rtable that are identified by the rowMarks array
> must relate to tables that are FOR UPDATE.
>
> In the UPDATE or DELETE statements the ‘WHERE CURRENT OF <cursor_name>’
> clause results in the cursor name being placed in the UpdateStmt or
> DeleteStmt structure. During the processing of the functions -
> transformDeleteStmt() and transformUpdateStmt() - the cursor name is used to
> obtain a pointer to the related Portal structure and the tuple affected by
> the current UPDATE or DELETE statement is extracted from the Portal, where it
> has been placed as the result of a previous FETCH request. At this point all
> the information for the UPDATE or DELETE statement is available so the
> statements can be transformed into standard UPDATE or DELETE statements and
> sent for re-write/planning/execution as usual.
>
> 2.4 Changes to the Optimizer
> ------------------------------
> There is a need to add a TidScan node to planning UPDATE / DELETE statements
> where the statements are ‘UPDATE / DELETE at position’. This is to enable the
> tuple ids of the tuples in the tables relating to the query to be obtained.
> There will need to be a new mechanism to achieve this, as at present, a Tid
> scan is done only if there is a standard WHERE condition on update or delete
> statements to provide Tid qualifier data.
>
>
> 2.5 Changes to the Executor
> -------------------------------
> There are various options that have been considered for this part of the
> enhancement. These are described in the sections below.
>
> We would like to hear opinions on which option is the best way to go or if
> none of these is acceptable, any alternate ideas ?
>
> Option 1 MVCC Via Continuous Searching of Database
>
> The Executor is to be changed in the following ways:
> 1) When the FETCH statement is executed the id of the resulting tuple is
> extracted and passed back to the Portal structure to be saved to indicate the
> cursor is currently positioned on a tuple.
> 2) When the UPDATE or DELETE request is executed the tuple id previously
> FETCHed is held in the QueryDesc structure so that it can be compared with
> the tuple ids returned from the TidScan node processed prior to the actual
> UPDATE / DELETE node in the plan. This enables a decision to be made as to
> whether the tuple held in the cursor is visible to the UPDATE / DELETE
> request according to the rules of concurrency. The result is that, at the
> cost of repeatedly searching the database at each UPDATE / DELETE command,
> the hash table is no longer required.
> This approach has the advantage that there is no hash table held in memory or
> on disk so it will not be memory intensive but will be processing intensive.
>
> This is a good ‘one-off’ solution to the problem and, taken in isolation is
> probably the best approach. However, if one considers the method(s) used in
> other areas of PostgreSQL, it is probably not the best solution. This option
> will probably not be used further.
>
> Option 2 MVCC via New Snapshot
>
> The executor can be changed by adding a new kind of snapshot that is
> specifically used for identifying if a given tuple, retrieved from the
> database during an update or delete statement should be visible during the
> current transaction.
>
> This approach requires a new kind of snapshot (this idea was used by Gavin
> for a previous updatable cursor patch but objections were raised.)
>
> Option 3 MVCC Via Hash Table in Memory
>
> The executor can be changed by saving into a hash table and comparing each
> tuple in the cursor with that set to check if the tuple should be visible.
> This approach has the advantage that it will be quick. It has the
> disadvantage that, since the hash table will contain all the tuples of the
> table being checked that it may use all local memory for a large table.
>
> Option 4 MVCC Via Hash Table on Disk
>
> When the UPDATE or DELETE request is executed the first time the Tid scan
> database retrieval will be done first. At this time the tuple id of each row
> in the table to be updated by the request will be available in the executor.
> These tuple ids need to be stored in a hash table that is stored to disk, as,
> if the table is large there could be a huge number of tuple ids. This data is
> then available for comparison with the individual tuple to be updated or
> deleted to check if it should be processed. The hash table will exist for the
> duration of the transaction, from BEGIN to END (or ABORT).
>
> The hash table is then used to identify if the tuple should be visible during
> the current transaction. If the tuple should be visible then the update or
> delete proceeds as usual.
>
> This approach has the advantage that it will use little memory but will be
> relatively slow as the data has to be accessed from disk.
>
> Option 5 Store Tuple Id in Snapshot.
>
> The Snapshot structure can be changed to include the tuple id. This enables
> the current state of the tuple to be identified with respect to the current
> transaction.
> The tuple id, as identified in the cursor at the point where the
> DELETE/UPDATE statement is being processed, can use the snapshot to identify
> if the tuple should be visible in the context of the current transaction.
>
>
> 2.6 Changes to the Catalog
> ----------------------------
> The Catalog needs to reflect changes introduced by the updatable cursor
> implementation. A boolean attribute ‘is_for_update’ is to be added to the
> pg_cursors implementation. It will define that the cursor is for update
> (value is FALSE) or for share (value is TRUE, the default value).
>
>
> 3 Design Assumptions
> ----------------------------
> The following design assumptions are made:
>
> As PostgreSQL8.2 does not support the SENSITIVE cursor option the tuples
> contained in a cursor can never be updated so these tuples will always appear
> in their ‘original’ form as at the start of the transaction. This is in
> breach of the SQL2003 Standard as described in 5WD-02-Foundation-2003-09.pdf,
> p 810. The standard requires the updatable cursor to be declared as sensitive.
>
> With respect to nested transactions – In PostgreSQL nested transactions are
> implemented by defining ‘save points’ via the keyword SAVEPOINT. A ‘ROLLBACK
> TO SAVEPOINT’ rolls back the database contents to the last savepoint in this
> transaction or the begin statement, whichever is closer.
>
> It is assumed that the FETCH statement is used to return only a single row
> into the cursor with each command when the cursor is updatable.
>
> According to the SQL2003 Standard Update and Delete statements may contain
> only a single base table.
>
> The DECLARE CURSOR statement is supposed to use column level locking, but
> PostgreSQL supports only row level locking. The result of this is that the
> column list that the standard requires ‘DECLARE <cursor_name> SELECT … FOR
> UPDATE OF column-list’ becomes a relation (table) list.
>
> This is an email from Fujitsu Australia Software Technology Pty Ltd, ABN 27 003 693 481. It is confidential to the ordinary user of the email address to which it was addressed and may contain copyright and/or legally privileged information. No one else may read, print, store, copy or forward all or any of it or its attachments. If you receive this email in error, please return to sender. Thank you.
>
> If you do not wish to receive commercial email messages from Fujitsu Australia Software Technology Pty Ltd, please email unsubscribe@fast.fujitsu.com.au
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>



--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:40 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 26