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
Reply
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
Keith Chisarik (04/02/2007)
Actually I get an error when calling add() on the BO after adding your code. If I remove your code, it runs fine again, but back to a crawl.



The column is set to not allow nulls, and has a default value of 0 defined.





System.Data.NoNullAllowedException was unhandled by user code

Message="Column 'rent_RPMrecnum' does not allow nulls."

Source="System.Data"

StackTrace:

at System.Data.DataColumn.CheckNullable(DataRow row)

at System.Data.DataTable.RaiseRowChanging(DataRowChangeEventArgs args, DataRow eRow, DataRowAction eAction, Boolean fireEvent)

at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)

at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)

at System.Data.DataRowCollection.Add(DataRow row)

at MicroFour.StrataFrame.Business.BusinessLayer.NewRow()

at MicroFour.StrataFrame.Business.BusinessLayer.Add(Boolean CheckSecurity)

at MicroFour.StrataFrame.Business.BusinessLayer.Add()

at ladesktop.frmSyncTables.syncrentitems(String p_sqlstring) in V:\2005 Projects\LightActionRPMScan\ladesktop\frmSyncTables.vb:line 564

at ladesktop.frmSyncTables.bgwRentitemsSync_DoWork(Object sender, DoWorkEventArgs e) in V:\2005 Projects\LightActionRPMScan\ladesktop\frmSyncTables.vb:line 103

at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)

at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)





this is the problem, can you help with this. I think my problem is misunderstood, the BO.Seek() is horribly slow unless the primary key on the BO is changed to the field I am seeking against as Ben suggested above, BUT when I do this, calling BO.Add() results in the error above even thought I have default values defined for all my "NON NULL" fields.

Keith Chisarik
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




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

With FORTRAN. [Crazy] [/quote]

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

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search