Solved

Database problems

Posted on 2006-11-09
9
156 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
 
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now