seek() slowness


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I have some code that loops through about 1/4 of a million records, it is taking a very long time (I stopped it after 15 minutes and it wasn't close to done).



I took out all the processing in the loop so that all it was doing was the loop with a single seek() and it was still slow. I replaced the seek() with "if 1 =2 then" and it went as expected (about 20 seconds).



I am seek()ing against a single integer field that I have an index on in SQL. Help????



Code:

searchstr = "rent_RPMrecnum = " & "'" & currow("record_number") & "'"

'If Me.RentitemsBO1.Seek(searchstr) Then

‘do nothing

Else

‘still do nothing for testing purposes

End if





Thanks.










Keith Chisarik
Replies
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Trent: /points and laughs

Not at all!!!  Wink

and yes, that is the column I set to be the new PK

The reason that we have never done this is because there are better ways to work through large data sets.  This is, I beleive, what Greg was reffering to in his post regarding "SQL base."  You are correct that VFP could handle 1 million records plus very easily...but SQL can go MUCH bigger.  You are used to working in a "connected" data environment, which was FoxPro and the reason for all of the corrupted memo fields Smile  With SQL Server and business objects, you are working in a disconnected environment so you want to work with as little data on the client side as possible.

When we need to work with very large data sets, for example prescription contraindications which can have a a million+ plus records to deal with.  We create an SQL Project and deploy it to SQL Server and then execute it through a stored procedure.  The DDT will automatically create the stored procedures required in order to execute it for you.  What is nice about this all of the work is done on the server, like a T-SQL stored procedure, but you are talking ADO.NET or whatever you you need.  You can then send your ADO.NET results back to the BO.  This is the best approach when dealing with large data sets....or create a T-SQL stored procedure, but this is not nearly as fun Smile


Ben Hayat
Ben Hayat
Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
The reason that we have never done this is because there are better ways to work through large data sets. This is, I beleive, what Greg was reffering to in his post regarding "SQL base." You are correct that VFP could handle 1 million records plus very easily...but SQL can go MUCH bigger. You are used to working in a "connected" data environment, which was FoxPro and the reason for all of the corrupted memo fields [Smile] With SQL Server and business objects, you are working in a disconnected environment so you want to work with as little data on the client side as possible.



When we need to work with very large data sets, for example prescription contraindications which can have a a million+ plus records to deal with. We create an SQL Project and deploy it to SQL Server and then execute it through a stored procedure. The DDT will automatically create the stored procedures required in order to execute it for you. What is nice about this all of the work is done on the server, like a T-SQL stored procedure, but you are talking ADO.NET or whatever you you need. You can then send your ADO.NET results back to the BO. This is the best approach when dealing with large data sets....or create a T-SQL stored procedure, but this is not nearly as fun




Hi Trent; This was a very valuable point. Could you please make a note to bring this up in the class to cover it in more detail?



Much appreciated!

..ßen
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Keith Chisarik - 19 Years Ago
Greg McGuffey - 19 Years Ago
Keith Chisarik - 19 Years Ago
StrataFrame Team - 19 Years Ago
Keith Chisarik - 19 Years Ago
Keith Chisarik - 19 Years Ago
StrataFrame Team - 19 Years Ago
StrataFrame Team - 19 Years Ago
Keith Chisarik - 19 Years Ago
Keith Chisarik - 19 Years Ago
Keith Chisarik - 19 Years Ago
Keith Chisarik - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Ben Hayat - 19 Years Ago
Greg McGuffey - 19 Years Ago
Greg McGuffey - 19 Years Ago
Keith Chisarik - 19 Years Ago
Ben Hayat - 19 Years Ago
Keith Chisarik - 19 Years Ago
Keith Chisarik - 19 Years Ago
Trent L. Taylor - 19 Years Ago
Greg McGuffey - 19 Years Ago
                     I did! With FORTRAN. :crazy:
Ivan George Borges - 19 Years Ago
                         [quote]I did!

With FORTRAN. [Crazy] [/quote]

IBM...
Ben Hayat - 19 Years Ago
                             What's a punch card? :D
StrataFrame Team - 19 Years Ago
                                 1983 - Keith was 10, Trent was 7, Ben was 2 -- ok I am a little older...
Steve L. Taylor - 19 Years Ago
                                     [quote][b]Steve L. Taylor (04/03/2007)[/b][hr]1983 - Keith was 10,...
Ivan George Borges - 19 Years Ago
                                     [quote][b]Steve L. Taylor (04/03/2007)[/b][hr]1983 - Keith was 10,...
Ben Hayat - 19 Years Ago
                             [quote][b]Ben Hayat (04/03/2007)[/b][hr][quote]I did! With FORTRAN....
Ivan George Borges - 19 Years Ago
                                 [quote][b]Ivan George Borges (04/03/2007)[/b][hr][quote][b]Ben Hayat...
Ben Hayat - 19 Years Ago
                                     OK, back to business... Keith, if you change the column that is the...
StrataFrame Team - 19 Years Ago
                                         I'm going to throw out another approach. Is it possible to just...
Greg McGuffey - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search