473,379 Members | 1,511 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,379 software developers and data experts.

Anyone ever run into situation where time advanced by 1 second during large WRITE?

MLH
Suppose you're using a query to update or append many records in a
large table. And suppose one of those fields is a T/D stamp table and
you're using Now() to write its value. It is conceivable that a large
number of records could take a few milliseconds to write and that the
time could change from 13:00:00 to 13:00:01 between the time the first
record was modified and the time the last was modified.

Now I've never seen that happen. But I'm wondering if any of you have?

Sometimes, it is convenient fort all mods have the same T/D stamp.
If it can happen, I may wish to assign a variant the value of Now() to
FIX the value and use that to furnish the value to each of the record
writes instead of Now() - whose value changes with time.

Comments?
Jul 7 '07 #1
4 1341
I can't answer you question but AFAIK, standard SQL mandates that data
affecting operations such as UPDATE occur for all rows simultaneously,
(regardless of any sequential processing in the lower-level
implementation). The fact that this is not the case in Jet can be
illustrated by the following. Given table foo:

create table foo
(
id int not null primary key,
lineNbr int not null unique
)

with some data
insert into foo(id, lineNbr) values(1,1)
insert into foo(id, lineNbr) values(2,2)

The following sql *should* be valid:

update foo set lineNbr = IIf(lineNbr = 1, 2, 1)

But in fact this will fail against a jet database. Other database
engines such as sql server use "deferred constraint checking" and allow
the above to succeed.

I would think however that in your example, the query optimizer would be
smart enough to call now() only once and then use that value for all rows.


MLH wrote:
Suppose you're using a query to update or append many records in a
large table. And suppose one of those fields is a T/D stamp table and
you're using Now() to write its value. It is conceivable that a large
number of records could take a few milliseconds to write and that the
time could change from 13:00:00 to 13:00:01 between the time the first
record was modified and the time the last was modified.

Now I've never seen that happen. But I'm wondering if any of you have?

Sometimes, it is convenient fort all mods have the same T/D stamp.
If it can happen, I may wish to assign a variant the value of Now() to
FIX the value and use that to furnish the value to each of the record
writes instead of Now() - whose value changes with time.

Comments?
Jul 7 '07 #2
On Sat, 07 Jul 2007 12:12:15 -0400, MLH <CR**@NorthState.netwrote:

I think that doesn't happen because of optimization. The query engine
realizes that ALL rows have the same formula, so it calls that formula
once, and uses that value to populate each row.

Same thing you can observe when you have a function of your own:
select CustomerID, MyFunction() from Customers
Access will call MyFunction only once.
If you want to force Access to call the function for each row, you
need to pass in a unique value even if it is not used in the function:
select CustomerID, MyFunction(CustomerID) from Customers

-Tom.

>Suppose you're using a query to update or append many records in a
large table. And suppose one of those fields is a T/D stamp table and
you're using Now() to write its value. It is conceivable that a large
number of records could take a few milliseconds to write and that the
time could change from 13:00:00 to 13:00:01 between the time the first
record was modified and the time the last was modified.

Now I've never seen that happen. But I'm wondering if any of you have?

Sometimes, it is convenient fort all mods have the same T/D stamp.
If it can happen, I may wish to assign a variant the value of Now() to
FIX the value and use that to furnish the value to each of the record
writes instead of Now() - whose value changes with time.

Comments?
Jul 7 '07 #3
MLH
Based on your comments, then, VBA won't read Now() more than
once in my example. And you've never seen any evidence to the
contrary. That's comforting.

What about a query executing row-by-row writing Now() to one
of the target fields and MyFunc(MyTableID) to another. Realizing
that they are separate fields, I wonder if forcing Access to call the
function for each row as you pointed out might result in Access
firing new calc's for all fields in each subsequent row - or just the
one field calling the FN with a unique passed value?

If I had a real slow disk - perhaps a floppy - I could test this.
Hmmm??? Dunno if the smallest mdb possible will even fit on
a floppy.
Jul 20 '07 #4
MLH
I understand - not the SQL you mentioned -
but your comments in general. Dunno any
more than I did before posting - except that
a couple of you believe that Now() would
propogate to zillions of records in a fixed
value amount.

That is, of course, what I want. I just wish
I could come up with some way to PROVE
it. I suppose I could write out several million
records to a table and do a test.

Maybe I could do something like
Dim StartTime, StopTime

StartTime = Now()
UPDATE ExtremelyLongTable SET ExtremelyLongTable .InDate = Now(),
ExtremelyLongTable .InType = '09'
StopTime = Now()

If the difference between StartTime and StopTime were
a few seconds, I would KNOW that substantial time passed
during the process. If the time written to all the records was
the same - then I'll have an answer - at least for that specific
SQL string.
Jul 20 '07 #5

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

Similar topics

1
by: asj | last post by:
Since Java runs eBay, is used to power most of the hundreds of millions of SIM cards in your cellphones, protects most of the security/healthcare smartcards of entire countries like taiwan, and is...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
5
by: tony | last post by:
I'm using PHP 5 on Win-98 command line (ie no web server involved) I'm processing a large csv file and when I loop through it I can process around 275 records per second. However at around...
3
by: cj | last post by:
If I want to check to see if it's after "11:36 pm" what would I write? I'm sure it's easy but I'm getting tired of having to work with dates and times. Sometimes I just want time or date. And...
2
by: Bernard Liang | last post by:
In response, I have another question about the scanf family. After reading in a %d value, for instance, do they immediately wade through all subsequent whitespace until a non-whitespace character...
1
by: trevor.farchild | last post by:
Hi, long time reader, first time poster I have an application that will be doing this 5 times a second: Get a bunch of data from a NetworkStream and convert it into a Bitmap Therefore, the...
26
by: Lionel B | last post by:
Hi, Anyone know if the Standard has anything to say about the time complexity of size() for std::set? I need to access a set's size (/not/ to know if it is empty!) heavily during an algorithm...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
19
by: William Gill | last post by:
I seem to be having a mentally bad period lately . My code is beginning to be terrible convoluted mess, and I shudder to think what it will be like to go back in a couple months and try to follow...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.