Re: jdbc question
From: Sudsy (bitbucket44_at_hotmail.com)
Date: 12/30/04
- Next message: Sudsy: "Re: field name for jOptionPane when using Eclipse?"
- Previous message: anonymous: "Re: How too.. ??"
- In reply to: Thomas Kellerer: "Re: jdbc question"
- Next in thread: Tony Morris: "Re: jdbc question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Dec 2004 11:45:54 -0500
Thomas Kellerer wrote:
<snip>
> Without specific requirements there is no way telling which version is
> better. If this is e.g. a data load that is performed during the night,
> the the solution is absolutely valid. If this is a use case with highly
> partioned data (each user edits different records) then it's valid as
> well, if the situation is a highly dynamic entry system where the
> situation that you sketched is very likely to happen, then obviously
> this is not a good idea. On the other hand: if you expect more updates
> then inserts to be successful, the overall performance would be *much*
> better this way because the index lookup for the primary key is only
> needed once for the update but twice for the inser/update combo.
>
> I was simply offering a different solution. If it's feasible for the
> situation of the OP is up to him (and he did not give information to us
> in order to judge that)
Thomas,
You raise an excellent point. You can't optimize your approach unless
you know how the database is going to be used. In some situations you're
going to have a lot of inserts (e-commerce, for example) while in others
you're only performing updates (e.g. banking).
Goodness knows, if you're doing a batch load on some databases then
you're better off dropping the indices, performing the load, then
recreating the indices. It takes less time than updating the indices
when loading records individually.
Which only goes to show that JDBC programmers should be familiar
with underlying database concepts. Thanks for sharing your ideas!
- Next message: Sudsy: "Re: field name for jOptionPane when using Eclipse?"
- Previous message: anonymous: "Re: How too.. ??"
- In reply to: Thomas Kellerer: "Re: jdbc question"
- Next in thread: Tony Morris: "Re: jdbc question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|