Roger Reinsch
Registered User.
- Local time
- Yesterday, 17:48
- Joined
- Sep 3, 2012
- Messages
- 18
I'm redesigning a database that had 1 master table and 5 dependent tables - all with one to one linkage. The 6 table structure was to save space by not creating rows in the dependent tables when that sort of data was absent.
The queries, while not hard, were complicated in that they all had more than one table and needed Left-Outer-Join linkage most of the time. I got advice on this forum that it made more sense to have all one table. So that's what I've done this go.
With separate tables, I automatically had a way to time stamp changes made to those sections. If Access wanted to write it, it had changed. Period. So a simple data macro that did Setfield LastChange Now().
To get that same level of change notification with the single table, there are lots of SetLocalVar Changed Old.Field <> Field or (old.field is null and field is not null) or (old.field is not null and field is null) {author note: I hate nulls} to detect changes. Then the appropriate set of these "Changed" Local variables are ORed together in an IF statement to put a new timestamp in the appropriate field.
The new data macro {I really wish these could be written in VBA} is about 1500 lines in "pretty" XML. I've tested it with a form that shows all the fields and when any field changes, the timestamp does get set in the right place.
But now for the performance problem.
For testing, I'm doing an append query to an emptied out table. The first hundred or so rows go in at about 60 a second. I can live with that. To populate the table with production data of 125,000 rows would take 35 minutes or so. During testing I'm appending about 1700 rows and the last rows are going in at 2 (two) per second. This is not OK. Here are more numbers.
Row 100 - 60 per second
Row 200 - 20 per second
Row 300 - 12 per second
Row 400 - 8 per second
Row 500 - 6 per second
Row 600 - 5 per second
Row 700 - 4 per second
Row 900 - 3.5 per second (average near row 900)
Row 1100 - 3 per second
Row 1300 - 2.5 per second
Row 1500 - 2.1 per second
Row 1700 - 2.0 per second
I don't know what's going on. It will take to the end of time for the production data to load. Any thoughts would be appreciated. Thanks. Roger
[Access 2013 (32 bit), Win 7 Pro SP1 (64 bit), 16GB ram, Intel i-7 3930K]
The queries, while not hard, were complicated in that they all had more than one table and needed Left-Outer-Join linkage most of the time. I got advice on this forum that it made more sense to have all one table. So that's what I've done this go.
With separate tables, I automatically had a way to time stamp changes made to those sections. If Access wanted to write it, it had changed. Period. So a simple data macro that did Setfield LastChange Now().
To get that same level of change notification with the single table, there are lots of SetLocalVar Changed Old.Field <> Field or (old.field is null and field is not null) or (old.field is not null and field is null) {author note: I hate nulls} to detect changes. Then the appropriate set of these "Changed" Local variables are ORed together in an IF statement to put a new timestamp in the appropriate field.
The new data macro {I really wish these could be written in VBA} is about 1500 lines in "pretty" XML. I've tested it with a form that shows all the fields and when any field changes, the timestamp does get set in the right place.
But now for the performance problem.
For testing, I'm doing an append query to an emptied out table. The first hundred or so rows go in at about 60 a second. I can live with that. To populate the table with production data of 125,000 rows would take 35 minutes or so. During testing I'm appending about 1700 rows and the last rows are going in at 2 (two) per second. This is not OK. Here are more numbers.
Row 100 - 60 per second
Row 200 - 20 per second
Row 300 - 12 per second
Row 400 - 8 per second
Row 500 - 6 per second
Row 600 - 5 per second
Row 700 - 4 per second
Row 900 - 3.5 per second (average near row 900)
Row 1100 - 3 per second
Row 1300 - 2.5 per second
Row 1500 - 2.1 per second
Row 1700 - 2.0 per second
I don't know what's going on. It will take to the end of time for the production data to load. Any thoughts would be appreciated. Thanks. Roger
[Access 2013 (32 bit), Win 7 Pro SP1 (64 bit), 16GB ram, Intel i-7 3930K]