|
Post by Rod on Jul 28, 2020 10:04:21 GMT -5
I would suggest that meerkat learning everything he needs to know about horse racing to complete this project is the same challenge milfredo has in learning everything he needs to know about SQL.
There is nothing wrong with a flat file database, basic integrity is a given, you don’t want five records about the same race/horse.
But if that is covered then you can analyse the heck out a flat file easily. With today’s PC power it won’t take to long.
I don’t want milfredo feeling that his current approach is flawed, it isn’t it is a perfectly valid way to proceed.
|
|
|
Post by milfredo on Jul 28, 2020 19:45:49 GMT -5
Thank you guys. I could end up with 250,000 records. What are the limits in LB for the size of a Random Access File?
|
|
|
Post by Rod on Jul 29, 2020 2:05:00 GMT -5
The limits are less to do with the size of the RAF and more to do with how many records you need to process at any one time and the time it will take. I expect your normal process would be to select a list of record pointers from the RAF based on criteria. You would, and I guess, select out a list of a few thousand record pointers. Then you would sum only those few thousand records by running through the record pointers list and GET the info to sum.
You would probably sum the whole database once and keep note of those overall ratios or averages. Or as you add or delete records change those ratios or averages. You should not be summing the entire dataset very often.
You can dummy it up, create. RAF with 250k similar records change a few criteria then select out those changed record pointers. Let’s see how long it takes to get 100 record pointers from 250k records.
|
|
|
Post by Rod on Jul 29, 2020 3:26:20 GMT -5
Ok I created 250000 records, amended at random 1000 then searched for those records. Here are my timings.
And the code
OPEN "members.dat" FOR RANDOM AS #1 LEN=256 FIELD #1,_ ' set up the fields for file opened as #1 90 AS Name$,_ ' 1st 90 bytes contains Name$, string 110 AS Address$,_ ' 2nd 110 bytes contains Address$, string 50 AS Rank$,_ ' 3rd 50 bytes contains Rank$, string 6 AS IDnumber ' 4th 6 bytes contains IDnumber, numeric
print "Building file" t=time$("ms") for n= 1 to 250000 PUT #1,n next print "File created with 250,000 records in ";time$("ms")-t print
t=time$("ms") Rank$="Hello" print "Amending 1000 records" for n= 1 to 1000 m=int(rnd(0)*250000+1) put #1 ,m next print "Amendments complete in ";time$("ms")-t print
t=time$("ms") found=0 print "Searching for records containing Hello" for n=1 to 250000 GET #1,n if instr(Rank$,"Hello",1) then found=found+1 'if you wanted to use this selection again 'store the found record pointers in an array next print "Found ";found;" records" print "Search completed in ";time$("ms")-t print
close #1 'you should kill or delete the dummy members.dat
|
|
|
Post by Rod on Jul 29, 2020 3:46:26 GMT -5
I do recall leaving my first real database running its query overnight! We used to turn up at the office with some trepidation in the morning. Twentysix seconds to select out 1000 records aint bad.
Well! I just tried LB5 and found it was TEN times faster, wow!
I don't find 1000 records because I am randomly placing them and some get written to the same place, just in case folks were wondering.
|
|
|
Post by milfredo on Jul 29, 2020 12:47:43 GMT -5
Thanks Rod. Any idea wen LB5 will be available?
|
|
|
Post by Rod on Jul 29, 2020 13:33:49 GMT -5
Don't worry about LB5 it is an Alpha so will be a while yet. You need to complete your program first, but now you know you have a "get out of jail card".
|
|
|
Post by Carl Gundel on Jul 29, 2020 14:03:08 GMT -5
Thanks Rod. Any idea wen LB5 will be available? It's available already, but it isn't finished. So if you want to try it out there's no charge.
|
|
|
Post by milfredo on Jul 29, 2020 15:38:04 GMT -5
That would be awesome Carl. How do I get it?
|
|
|
Post by Carl Gundel on Jul 29, 2020 16:24:07 GMT -5
|
|
|
Post by milfredo on Jul 29, 2020 19:58:13 GMT -5
I'm not the brightest Bulb... So a question. If I build program with the 64bit version will guys with 32bit machines be able to run the program?
|
|
|
Post by Chris Iverson on Jul 29, 2020 23:57:55 GMT -5
Basic answer: no. A 64-bit executable cannot be run on a 32-bit system. 32-bit executables CAN be run on 64-bit systems, if the 64-bit system is designed to support 32-bit applications. (Both Windows and Linux and compatibility layers that allow 32-bit apps to function in a 64-bit environment. If those compatibility layers are removed, you can't run 32-bit apps on the 64-bit system.)
Complex answer: Possibly, but that depends on how the final compilation process actually works, and it will still require using a different runtime engine. So, even if you only have to "compile" it once(and I don't know if that's the case, I don't know how compilation and distribution will work on LB5), you will still have to provide separate bundles for 32-bit vs 64-bit.
EDIT: Note that this all only applies to compiled programs. Obviously, source code will(should?) work identically either way.
|
|
|
Post by theulimateunltd on Oct 7, 2021 23:13:31 GMT -5
|
|
|
Post by Brandon Parker on Oct 8, 2021 10:45:13 GMT -5
The ODBC API Reference at MSDN is a great place to start. There are some demos from Dennis McKinney out there, but I can not find a reference to it on the web at the moment. I will consult with the other Admins/Mods to see if we can post the work that he provided in the past. {:0) Brandon Parker
|
|
|
Post by metro on Oct 9, 2021 0:42:19 GMT -5
|
|