Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Performance > Re: Partitionin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 4067 of 4156
Post > Topic >>

Re: Partitioning: INSERT 0 0 but want INSERT 0 1

by nik9000@[EMAIL PROTECTED] ("Nikolas Everett") May 12, 2008 at 11:46 PM

------=_Part_4983_14166436.1210650414651
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

If I can't find an answer in the next day or so I'll crack open OpenJPA
and
disable that check.  Its a very simple, if ugly, hack.

--Nik


On 5/12/08, Neil Peter Braggio <pbraggio@[EMAIL PROTECTED]
> wrote:
>
> I have the same problem in PG 8.2
>
> To resolve this issue I had to create a new table with the same
> structure than the partitioned table with a trigger for insert and
> update. All the operations the application have to do are directed to
> this new table.
>
> When a new record is inserted in the new table the trigger insert a
> new record with the same values into the partitioned table and then
> delete all records from this new table. In updates operations the
> trigger redirect the operation to the partitioned table too.
>
> With this _not elegant_ solution our Java application is able to do its
> job.
>
> If you find a better solution please let me know.
>
> ----
> Neil Peter Braggio
> pbraggio@[EMAIL PROTECTED]
>
>
> On Tue, May 13, 2008 at 11:48 AM, Nikolas Everett <nik9000@[EMAIL PROTECTED]
>
> wrote:
> > I figure this subject belongs on the performance mailing list because
it
> is
> > about partitioning, which is a performance issue.
> >
> > I'm working on partitioning some of the tables used by an application
> that
> > uses OpenJPA.  It turns out that OpenJPA is sensitive to the numbers
> > returned when you do an insert.  So I put together a test and attached
> it.
> > My postgres version is 8.3.1 compiled from source.
> >
> > My problem is that this:
> > test=> INSERT INTO ttt (a, b) VALUES ('5-5-08', 'test11212');
> > INSERT 0 0
> > Time: 21.646 ms
> > needs to show:
> > INSERT 0 1
> >
> > or OpenJPA will not accept it.  The insert works, but OpenJPA does not
> > believe it and aborts the current transaction.
> >
> > Is it possible to have partitioning and have insert show the right
> number of
> > rows inserted?
> >
> > Thanks,
> >
> > --Nik
> >
> >
> >  --
> >  Sent via pgsql-performance mailing list (
> pgsql-performance@[EMAIL PROTECTED]
)
> >  To make changes to your subscription:
> >  http://www.postgresql.org/mailpref/pgsql-performance
> >
> >
>
> --
> Sent via pgsql-performance mailing list
(pgsql-performance@[EMAIL PROTECTED]
)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-performance
>

------=_Part_4983_14166436.1210650414651
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div>If I can&#39;t find an answer in the next day or so I&#39;ll crack
open OpenJPA and disable that check.&nbsp; Its a very simple, if ugly,
hack.</div>
<div>&nbsp;</div>
<div>--Nik<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 5/12/08, <b
class="gmail_sendername">Neil Peter Braggio</b> &lt;<a
href="mailto:pbraggio@[EMAIL PROTECTED]
">pbraggio@[EMAIL PROTECTED]
>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px
0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I have the same problem in PG
8.2<br><br>To resolve this issue I had to create a new table with the
same<br>
structure than the partitioned table with a trigger for insert
and<br>update. All the operations the application have to do are directed
to<br>this new table.<br><br>When a new record is inserted in the new
table the trigger insert a<br>
new record with the same values into the partitioned table and
then<br>delete all records from this new table. In updates operations
the<br>trigger redirect the operation to the partitioned table
too.<br><br>With this _not elegant_ solution our Java application is able
to do its job.<br>
<br>If you find a better solution please let me know.<br><br>----<br>Neil
Peter Braggio<br><a
href="mailto:pbraggio@[EMAIL PROTECTED]
">pbraggio@[EMAIL PROTECTED]
><br><br><br>On Tue,
May 13, 2008 at 11:48 AM, Nikolas Everett &lt;<a
href="mailto:nik9000@[EMAIL PROTECTED]
">nik9000@[EMAIL PROTECTED]
>&gt; wrote:<br>
&gt; I figure this subject belongs on the performance mailing list because
it is<br>&gt; about partitioning, which is a performance
issue.<br>&gt;<br>&gt; I&#39;m working on partitioning some of the tables
used by an application that<br>
&gt; uses OpenJPA.&nbsp;&nbsp;It turns out that OpenJPA is sensitive to
the numbers<br>&gt; returned when you do an insert.&nbsp;&nbsp;So I put
together a test and attached it.<br>&gt; My postgres version is 8.3.1
compiled from source.<br>&gt;<br>
&gt; My problem is that this:<br>&gt; test=&gt; INSERT INTO ttt (a, b)
VALUES (&#39;5-5-08&#39;, &#39;test11212&#39;);<br>&gt; INSERT 0 0<br>&gt;
Time: 21.646 ms<br>&gt; needs to show:<br>&gt; INSERT 0 1<br>&gt;<br>&gt;
or OpenJPA will not accept it.&nbsp;&nbsp;The insert works, but OpenJPA
does not<br>
&gt; believe it and aborts the current transaction.<br>&gt;<br>&gt; Is it
possible to have partitioning and have insert show the right number
of<br>&gt; rows inserted?<br>&gt;<br>&gt; Thanks,<br>&gt;<br>&gt;
--Nik<br>&gt;<br>
&gt;<br>&gt;&nbsp;&nbsp;--<br>&gt;&nbsp;&nbsp;Sent via pgsql-performance
mailing list (<a
href="mailto:pgsql-performance@[EMAIL PROTECTED]
">pgsql-performance@[EMAIL PROTECTED]
>)<br>&gt;&nbsp;&nbsp;To
make changes to your subscription:<br>&gt;&nbsp;&nbsp;<a
href="http://www.postgresql.org/mailpref/pgsql-performance">http://www.postgresql.org/mailpref/pgsql-performance</a><br>
&gt;<br>&gt;<br><br>--<br>Sent via pgsql-performance mailing list (<a
href="mailto:pgsql-performance@[EMAIL PROTECTED]
">pgsql-performance@[EMAIL PROTECTED]
>)<br>To
make changes to your subscription:<br><a
href="http://www.postgresql.org/mailpref/pgsql-performance">http://www.postgresql.org/mailpref/pgsql-performance</a><br>
</blockquote></div><br>

------=_Part_4983_14166436.1210650414651--
 




 1 Posts in Topic:
Re: Partitioning: INSERT 0 0 but want INSERT 0 1
nik9000@[EMAIL PROTECTED]  2008-05-12 23:46:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Sun Jul 6 15:51:16 CDT 2008.