Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15628

Access(mdb) Performance Issue

$
0
0
Hi All,

I have found some interesting performance issues with a legacy application that uses an Access(mdb) database which is located on the local hard drive. When the main form performs an action(change filter, etc) changes are made to the data (various processing steps)and the script below has performance issues sometimes.

  • The sample script below sometimes takes 0.1 of a second then it can take 30 seconds other times
  • Checking the query in Access is always very quick
  • Compacting does fix some times but it will occur again shortly (note can be slow in .Net but checking in Access is quick even without compacting)
  • Started with a new database & re-created but still no difference
  • Note 'FieldNoIndex' has no index because this application changes the filter to various fields so we can't apply an index on all fields
  • Note it will be moved to SQL Server but at this stage, we must use Access


Has anyone experienced this before or has any insights?

-- Application Details --
Table: Data: 12,000 rows
Table: ITM: 8,000
Framework 4.52

Code:

Public Sub TestDatatable()
        Dim SQL As String = " Select  Field1 From  ITM INNER JOIN
                            DATA ON  (ITM.Site = DATA.Site) AND (ITM.Item = DATA.Item)
                        Where  ITM.Site = 'Site1' AND  ITM.FieldNoIndex = 'Item1'"

        Dim dt As New DataTable("Table1")

        Using da As New OleDbDataAdapter(SQL, _Conn)
            ' Fill table
            da.Fill(dt)
        End Using
    End Sub

Thanks,
Adam.

Viewing all articles
Browse latest Browse all 15628

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>