vba - SQL Server Dmax speed -


I have a specified ADP that connects to a specified server / database

I have a date Need to get from the other database on the same server, but the speed is very slow.
How fast can I make this without any index?

Trial code:

  Options Database Options Comparison of Clear Sub Tests (string as tablename) Dim Q dim minus z as dd dimmed Q = timer z = DMax ("created", tablename) debug. Print "Dmax:"; Timer - q; "Sec" q = set timer cmd = create object ("adodb.command") set rs = object ("adodb. Recyclable") CMD. ActiveConcation = CurrentProject Connection CMD. Command Text: "Choose From (Made)" & amp; Tablename cmd.CommandTimeout = 0 set rs = cmd.Execute z = rs.Fields (0) .value debug.print "SQL:"; Timer - q; Set "sec" q = set cmd = CreateObject ("ADODB.Command") rs = CreateObject ("ADODB.Recordset") cmd.ActiveConnection = CurrentProject.Connection cmd.CommandText = "Select Top 1 Created" ; Tablename & amp; _ "Order by created order" cmd.CommandTimeout = 0 set rs = cmd.Execute z = rs.Fields (0) .value debug.print "Sq2L:"; Timer - q; "Second" and sub  

Result:

DMX: 102.4297 sec SQL: 59.87109 seconds: SQL 2L: 74.80078 seconds


Comments