Solved

Database problems

Posted on 2006-11-09
9
158 Views
Last Modified: 2013-11-13
Im using DAO to access a database file which contains 92,000 records.  Problem is thats it seems very slow performance wise.
The below line causes a 2-5 second pause which is fairly bad.  Is there any way to improve things?  Would using more tables instead oh having 92,000 records help?
Or would ADO be better?

    Set myrs = db.OpenRecordset(strsql, dbOpenDynaset) ' Causes BIG Pause
0
Comment
Question by:gerrymcd
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17905279
are you trying to get all 92K records using this?
what does the query look like?
does the table have appropriate indexes?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17905282
ps: what database?
0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17905550
No maybe just 100-300 at a time

typical query

        strsql = "select * from table1 where table1." & sfield & " = '" & sval & "'" '"ORDER BY filename ASC"

i made an index on the filename and path fields it seems to have speeded up the results to some degree.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 2

Author Comment

by:gerrymcd
ID: 17905590
Typical sql:

select * from table1 where table1.path like '*images\holidays*' AND collectionname = 'holidayphotos2006'  ORDER BY filename ASC

i basically have a collections of images which are contain in a folder and subffolders, theres are image collections (say holiday photos,birthdays,art)

ive put all them in the one table. should i put each collection of images in its own table?

0
 
LVL 15

Expert Comment

by:JackOfPH
ID: 17911852
It is better not to save the image in your database... instead just save the image path in the database...

0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17913203
the image is not being saved in the database, sry if that was unclear.
0
 
LVL 15

Accepted Solution

by:
JackOfPH earned 125 total points
ID: 17920075
Try to change the query to this...
strsql = "select * from table1 where table1." & sfield & " = '" & sval & "' ORDER BY filename ASC"
0
 
LVL 3

Expert Comment

by:herreruud
ID: 17928885
First of all,
What DB is this? If it's a DB Server, and not Access, it might help to put the SQL in a stored procedure.

Secondly, Is the database running on the same machine as your app? If not; switch to ADO.

0
 
LVL 2

Author Comment

by:gerrymcd
ID: 17928966
ive made each "group of files a collection of images" be made in a new table instead of 1 big tanle with 90,000+ entries it seems to have speeded up things but it makes things a bit akward.  any other tips or ideas?
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question