473,288 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,288 software developers and data experts.

composite keys and delete performance

Hi All,
I am about to make some changes to a process we have. The new process
will have a new table who's job it is to store temporarily data such
as customer, clerkno,productno, storeno , amount, time.

On a new request from a front-end i will select against the primary
keys to ensure no other request for the same data has been made. This
is then sent to a backend system asynchronously if there is no match.
I will otherwise send a reject msg back to the store if i have the
same data in the table.

On the reply from the backend, i delete this record.
Now this table will hardly ever be filled as messages will be stored
and deleted within a second.

My question is, should i create this table with a single primary key
such as a sequence number or should it be a composite key of say
(customer, clerkno,productno, storeno).
I ask because, i am reluctant to have composite if the database is
maintaining indexes against each primary key column. I.e. four indexes
will have be be maintained for each insert or delete.

Should i just go with a single column sequence pk and then i just
index my customer column for a more restrictive select statement. Any
suggestions?

Thanks,

Mar 22 '08 #1
2 3487
"lfhenry" <lf*****@gmail.comwrote in message
news:c5**********************************@8g2000hs u.googlegroups.com...
Hi All,
I am about to make some changes to a process we have. The new process
will have a new table who's job it is to store temporarily data such
as customer, clerkno,productno, storeno , amount, time.

On a new request from a front-end i will select against the primary
keys to ensure no other request for the same data has been made. This
is then sent to a backend system asynchronously if there is no match.
I will otherwise send a reject msg back to the store if i have the
same data in the table.

On the reply from the backend, i delete this record.
Now this table will hardly ever be filled as messages will be stored
and deleted within a second.

My question is, should i create this table with a single primary key
such as a sequence number or should it be a composite key of say
(customer, clerkno,productno, storeno).
I ask because, i am reluctant to have composite if the database is
maintaining indexes against each primary key column. I.e. four indexes
will have be be maintained for each insert or delete.

Should i just go with a single column sequence pk and then i just
index my customer column for a more restrictive select statement. Any
suggestions?

Thanks,
If you a composite primary key of (customer, clerkno,productno, storeno) DB2
will only create one index for this.
Mar 22 '08 #2
On Mar 22, 12:17*pm, "Mark A" <nob...@nowhere.comwrote:
"lfhenry" <lfhe...@gmail.comwrote in message

news:c5**********************************@8g2000hs u.googlegroups.com...


Hi All,
I am about to make some changes to a process we have. The new process
will have a new table who's job it is to store temporarily data such
as customer, clerkno,productno, storeno , amount, time.
On a new request from a front-end i will select against the primary
keys to ensure no other request for the same data has been made. This
is then sent to a backend system asynchronously if there is no match.
I will otherwise send a reject msg back to the store if i have the
same data in the table.
On the reply from the backend, i delete this record.
Now this table will hardly ever be filled as messages will be stored
and deleted within a second.
My question is, should i create this table with a single primary key
such as a sequence number or should it be a composite key of say
(customer, clerkno,productno, storeno).
I ask because, i am reluctant to have composite if the database is
maintaining indexes against each primary key column. I.e. four indexes
will have be be maintained for each insert or delete.
Should i just go with a single column sequence pk and then i just
index my customer column for a more restrictive select statement. Any
suggestions?
Thanks,

If you a composite primary key of (customer, clerkno,productno, storeno) DB2
will only create one index for this.- Hide quoted text -

- Show quoted text -
Great, composite key it is.
Thanks.
Mar 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matan Nassau | last post by:
Hello. i have a composite which i want to delete. this is a composite which represents a boolean expression (see a previous post of mine with more details at...
5
by: John | last post by:
Specifically for joint tables... tblStudents tblClasses tblClasses_Students Is it be good programming to use a composite primary key in tblClasses_Students (where the key is ClassID and...
18
by: Thomas A. Anderson | last post by:
I am a bit confused in creating a composite primary key. I have three table with two of the tables containing primary keys. I have two of the tables (each with a primary key) having one to many...
4
by: Ismail Rajput | last post by:
Is there any option we can use Composite DataKeyField in the DataList and DataGrid?
2
by: bobby_b_ | last post by:
I have a table where fields 1 and 2 make up the primary key. Because of this, I have a unique composite index on fields 1 and 2 (as required by DB2). Now my question is: Fields 1 and 2 are also...
6
by: mac | last post by:
Summary: 1. I want to define a column in anMS Access table to be lookups on other tables. 2. The table that is the data source (e.g the "parent" table) has a composite primary key. 3. When...
7
by: Ronald S. Cook | last post by:
My client manager likes concatenated/composite primary keys. I don't. Can anyone forward any arguments pro or con? Thanks, Ron
4
by: Wolfgang Keller | last post by:
Hello, so far it seems to me as if the only ORM module for Python which supports composite primary/foreign keys was SQLAlchemy. Which looks a little bit "overbloated" for my needs: I "just" need...
54
by: csolomon | last post by:
Hello: I was wondering if I could get some input on how to address a design issue, involving my composite table. I have one portion of my project complete. The following forms and reports I...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.