You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
|
Apr
(10) |
May
(17) |
Jun
(3) |
Jul
|
Aug
|
Sep
(8) |
Oct
(18) |
Nov
(51) |
Dec
(74) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(47) |
Feb
(44) |
Mar
(44) |
Apr
(102) |
May
(35) |
Jun
(25) |
Jul
(56) |
Aug
(69) |
Sep
(32) |
Oct
(37) |
Nov
(31) |
Dec
(16) |
2012 |
Jan
(34) |
Feb
(127) |
Mar
(218) |
Apr
(252) |
May
(80) |
Jun
(137) |
Jul
(205) |
Aug
(159) |
Sep
(35) |
Oct
(50) |
Nov
(82) |
Dec
(52) |
2013 |
Jan
(107) |
Feb
(159) |
Mar
(118) |
Apr
(163) |
May
(151) |
Jun
(89) |
Jul
(106) |
Aug
(177) |
Sep
(49) |
Oct
(63) |
Nov
(46) |
Dec
(7) |
2014 |
Jan
(65) |
Feb
(128) |
Mar
(40) |
Apr
(11) |
May
(4) |
Jun
(8) |
Jul
(16) |
Aug
(11) |
Sep
(4) |
Oct
(1) |
Nov
(5) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(5) |
May
(4) |
Jun
(12) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
|
4
|
5
(1) |
6
(1) |
7
(2) |
8
(3) |
9
|
10
|
11
(2) |
12
(6) |
13
|
14
(4) |
15
(6) |
16
(1) |
17
|
18
|
19
(5) |
20
(2) |
21
(3) |
22
(1) |
23
(4) |
24
(1) |
25
(5) |
26
(5) |
27
(2) |
28
|
29
(1) |
30
|
31
(1) |
|
|
|
|
|
|
From: Ashutosh B. <ash...@en...> - 2011-07-19 07:02:57
|
> >> I would personally have a different idea of doing this. We should have the >> sequence definitions on the data nodes as well, and data nodes should be >> able to retrieve the nextval of the sequences. Looking at the possibility of >> having multiple coordinators, we anyway need to synchronise nextval of >> sequences across coordinators. Same mechanism can be used to synchronise it >> across data nodes. In such case sending nextval(foo) through query won't be >> a problem. >> > What happens in the case of replicated tables? If datanodes receive a > nextval value locally tuples will be inconsistent. > Just for the case of replicated tables, it looks far simpler to let > Coordinator feed the queries with nextval. > Hmm, I didn't think of this case :( I think, this will be a generic problem, if the queries other than INSERT also use nextval() on sequences. There is less probability that SELECT will use it but UPDATEs are other potential candidates. > -- > Michael Paquier > http://michael.otacoo.com > -- Best Wishes, Ashutosh Bapat EntepriseDB Corporation The Enterprise Postgres Company |
From: Koichi S. <ko...@in...> - 2011-07-19 04:34:16
|
Hi, Postgres-XC document was updated in the following URLs: http://postgres-xc.sourceforge.net/xc-docs/html/ http://postgres-xc.sourceforge.net/xc-docs/postgres-xc-A4.pdf http://postgres-xc.sourceforge.net/xc-docs/postgres-xc-US.pdf This time, improved BARRIER description. --- Koichi Suzuki |
From: Michael P. <mic...@gm...> - 2011-07-19 03:56:28
|
On Tue, Jul 19, 2011 at 12:00 PM, Ashutosh Bapat < ash...@en...> wrote: > > > On Tue, Jul 19, 2011 at 8:00 AM, Michael Paquier < > mic...@gm...> wrote: > >> Hi all, >> >> I am currently studying about the ways to be able to feed default values >> to insert queries like for what is found for example for SERIAL and default >> values using time and sequence based functions. >> In XC planner, what is done currently is using a function called >> deparse_query in ruleutils.c to be able to rebuild a query string from a >> parse tree. >> >> I don't think this is correct as we may need to be able to rewrite a query >> after getting values corresponding to default expressions. This query >> rewrite should be done in executor after getting all the necessary values >> given by expressions. >> >> Let's get an example: >> CREATE SEQUENCE foo; >> CREATE TABLE aa (a int, b int DEFAULT nextval('foo')) DISTRIBUTE BY >> REPLICATION; --OK this is not supported yet by XC and returns an error, but >> let's imagine it is not the case. >> INSERT INTO aa VALUES (1, DEFAULT); >> >> In this case the query sent down to nodes is the one generated by >> deparse_query at planner level. >> It results in an error because the query sent down has the form: >> INSERT INTO aa (a, b) VALUES (1, nextval('foo'::regclass)) >> >> template1=# INSERT INTO aa VALUES (1, DEFAULT); >> ERROR: relation "foo" does not exist >> template1=# explain verbose INSERT INTO aa VALUES (1, DEFAULT); >> QUERY >> PLAN >> >> -------------------------------------------------------------------------------------------- >> Data Node Scan (Primary Node Count [1]) (Node Count [1]) >> (cost=0.00..0.00 rows=0 width=0) >> Output: 1, nextval('foo'::regclass) >> >> The problem is that foo is a sequence and it is only created at >> Coordinators. >> It is also necessary to generate this value on Coordinator to feed >> Datanodes with the same values. >> > > What happens when the INSERT queries are fired from different coordinators > in a multi-coordinator environment. > GTM always delivers unique sequence values with nextval as sequence value feed is protected by pthread lock on GTM. So we are sure about the uniquess of value. > > >> >> Do you guys have any idea of a mechanism that would permit to rewrite the >> query at executor level after getting the output of nextval? >> It may be sufficient to call deparse_query once again but it needs a parse >> tree and RemoteQuery plan does not have that. >> deparse_query also looks to be a function that should not be called in >> executor. >> > > Convert it into parameterised query with default values as parameters. > During execution pass the evaluated default values are parameter values to > the remote node. > That's a nice idea. It could make the deal when writing the query in planner. > > I would personally have a different idea of doing this. We should have the > sequence definitions on the data nodes as well, and data nodes should be > able to retrieve the nextval of the sequences. Looking at the possibility of > having multiple coordinators, we anyway need to synchronise nextval of > sequences across coordinators. Same mechanism can be used to synchronise it > across data nodes. In such case sending nextval(foo) through query won't be > a problem. > What happens in the case of replicated tables? If datanodes receive a nextval value locally tuples will be inconsistent. Just for the case of replicated tables, it looks far simpler to let Coordinator feed the queries with nextval. -- Michael Paquier http://michael.otacoo.com |
From: Ashutosh B. <ash...@en...> - 2011-07-19 03:00:47
|
On Tue, Jul 19, 2011 at 8:00 AM, Michael Paquier <mic...@gm...>wrote: > Hi all, > > I am currently studying about the ways to be able to feed default values to > insert queries like for what is found for example for SERIAL and default > values using time and sequence based functions. > In XC planner, what is done currently is using a function called > deparse_query in ruleutils.c to be able to rebuild a query string from a > parse tree. > > I don't think this is correct as we may need to be able to rewrite a query > after getting values corresponding to default expressions. This query > rewrite should be done in executor after getting all the necessary values > given by expressions. > > Let's get an example: > CREATE SEQUENCE foo; > CREATE TABLE aa (a int, b int DEFAULT nextval('foo')) DISTRIBUTE BY > REPLICATION; --OK this is not supported yet by XC and returns an error, but > let's imagine it is not the case. > INSERT INTO aa VALUES (1, DEFAULT); > > In this case the query sent down to nodes is the one generated by > deparse_query at planner level. > It results in an error because the query sent down has the form: > INSERT INTO aa (a, b) VALUES (1, nextval('foo'::regclass)) > > template1=# INSERT INTO aa VALUES (1, DEFAULT); > ERROR: relation "foo" does not exist > template1=# explain verbose INSERT INTO aa VALUES (1, DEFAULT); > QUERY > PLAN > > -------------------------------------------------------------------------------------------- > Data Node Scan (Primary Node Count [1]) (Node Count [1]) (cost=0.00..0.00 > rows=0 width=0) > Output: 1, nextval('foo'::regclass) > > The problem is that foo is a sequence and it is only created at > Coordinators. > It is also necessary to generate this value on Coordinator to feed > Datanodes with the same values. > What happens when the INSERT queries are fired from different coordinators in a multi-coordinator environment. > > Do you guys have any idea of a mechanism that would permit to rewrite the > query at executor level after getting the output of nextval? > It may be sufficient to call deparse_query once again but it needs a parse > tree and RemoteQuery plan does not have that. > deparse_query also looks to be a function that should not be called in > executor. > Convert it into parameterised query with default values as parameters. During execution pass the evaluated default values are parameter values to the remote node. I would personally have a different idea of doing this. We should have the sequence definitions on the data nodes as well, and data nodes should be able to retrieve the nextval of the sequences. Looking at the possibility of having multiple coordinators, we anyway need to synchronise nextval of sequences across coordinators. Same mechanism can be used to synchronise it across data nodes. In such case sending nextval(foo) through query won't be a problem. > > This is a key point for support of serial tables in XC. Any ideas about how > to handle that? > Add a parse tree in RemoteQuery plan? > Add an inner plan to rewrite query? > -- > Michael Paquier > http://michael.otacoo.com > > > ------------------------------------------------------------------------------ > Magic Quadrant for Content-Aware Data Loss Prevention > Research study explores the data loss prevention market. Includes in-depth > analysis on the changes within the DLP market, and the criteria used to > evaluate the strengths and weaknesses of these DLP solutions. > http://www.accelacomm.com/jaw/sfnl/114/51385063/ > _______________________________________________ > Postgres-xc-developers mailing list > Pos...@li... > https://lists.sourceforge.net/lists/listinfo/postgres-xc-developers > > -- Best Wishes, Ashutosh Bapat EntepriseDB Corporation The Enterprise Postgres Company |
From: Michael P. <mic...@gm...> - 2011-07-19 02:30:15
|
Hi all, I am currently studying about the ways to be able to feed default values to insert queries like for what is found for example for SERIAL and default values using time and sequence based functions. In XC planner, what is done currently is using a function called deparse_query in ruleutils.c to be able to rebuild a query string from a parse tree. I don't think this is correct as we may need to be able to rewrite a query after getting values corresponding to default expressions. This query rewrite should be done in executor after getting all the necessary values given by expressions. Let's get an example: CREATE SEQUENCE foo; CREATE TABLE aa (a int, b int DEFAULT nextval('foo')) DISTRIBUTE BY REPLICATION; --OK this is not supported yet by XC and returns an error, but let's imagine it is not the case. INSERT INTO aa VALUES (1, DEFAULT); In this case the query sent down to nodes is the one generated by deparse_query at planner level. It results in an error because the query sent down has the form: INSERT INTO aa (a, b) VALUES (1, nextval('foo'::regclass)) template1=# INSERT INTO aa VALUES (1, DEFAULT); ERROR: relation "foo" does not exist template1=# explain verbose INSERT INTO aa VALUES (1, DEFAULT); QUERY PLAN -------------------------------------------------------------------------------------------- Data Node Scan (Primary Node Count [1]) (Node Count [1]) (cost=0.00..0.00 rows=0 width=0) Output: 1, nextval('foo'::regclass) The problem is that foo is a sequence and it is only created at Coordinators. It is also necessary to generate this value on Coordinator to feed Datanodes with the same values. Do you guys have any idea of a mechanism that would permit to rewrite the query at executor level after getting the output of nextval? It may be sufficient to call deparse_query once again but it needs a parse tree and RemoteQuery plan does not have that. deparse_query also looks to be a function that should not be called in executor. This is a key point for support of serial tables in XC. Any ideas about how to handle that? Add a parse tree in RemoteQuery plan? Add an inner plan to rewrite query? -- Michael Paquier http://michael.otacoo.com |