public inbox for [email protected]
help / color / mirror / Atom feedFrom: Lok P <[email protected]>
To: [email protected]
Subject: Re: How batch processing works
Date: Sat, 5 Oct 2024 01:35:38 +0530
Message-ID: <CAKna9Vb39v+83mrsCV02W0yCKusW033rcc6bAOGKZj6qZBfsxQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAKna9VY2v0XsDberzbJXZ4MqEW1RUtD0L_Mis_vrgEQWZgH0gg@mail.gmail.com>
<[email protected]>
<CAKna9Vbt1VJu7Oa8FTWasgby+-kJn7omOhbfmWzkdpVwBiqNzQ@mail.gmail.com>
<[email protected]>
<CAKna9VZA5x1g7-4j8cQrW1ByqX5jtPwY7sY2MHuRgrxrOu4LBg@mail.gmail.com>
<[email protected]>
On Mon, Sep 23, 2024 at 12:53 AM Peter J. Holzer <[email protected]> wrote:
>
> > Thank you so much.
> > I was expecting method-3(batch insert) to be the fastest or atleast as
> you said
> > perform with similar speed as method-2 (row by row insert with batch
> commit)
>
> Oops, sorry! I wrote that the wrong way around. Method 3 is the fastest.
> I guess I meant to write "method2 takes about twice as long as method3"
> or something like that.
>
>
As in case of batch insert below is the fastest one as it inserts
multiple rows in one statement. Similarly I understand, Delete can be
batched as below. However, can you suggest how an Update can be batched in
a simple/generic fashion in JDBC for an input data stream with multiple
input values. As because for an update if we write as below , it will just
do one row update at a time?
Update <table_name> SET column1=?, column2=?, column3=? where
<PK_Column>=? ;
INSERT INTO <table_name> VALUES (1, 'a'), (2, 'a'),(3,'a');
Delete from <table_name> where column_name in (<value1>,
<value2>,<value3>...);
view thread (4+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected]
Subject: Re: How batch processing works
In-Reply-To: <CAKna9Vb39v+83mrsCV02W0yCKusW033rcc6bAOGKZj6qZBfsxQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox