Forum Moderators: phranque
Any ideas on how to improve the performance of MySQL would be appreciated.
Which ODBC [dev.mysql.com] driver are you using?
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I also tried the able-consulting DSN-less connection string variations, but I get the same error. Here's another one that I tried:
oConn.Open "Driver={mySQL};" & _
"Server=localhost;" & _
"Option=16834;" & _
"Database=mydb"
Is there additional driver software necessary other than MyODBC? Is the path to the DB required? (I tried that and it didn't help.) Should a DSN-less connection be faster than with a DSN? I found an OLEDB3 driver on the mysql site, but haven't tried that yet.
The SQL that is taking 14 seconds is suprisingly simple. Out of a table with 62000 records, I'm pulling out about 25-30 records with:
"select * from T where B = '" & session("bNum") & "' and NPI = " & PI & " order by NI"
My test server hardware is old. I'll try the same setup on newer hardware and see how much of a difference that makes.
Thanks for the ideas.
"select * from T where B = '" & session("bNum") & "' and NPI = " & PI & " order by NI"
Even if you have an index on each of those fields, MySQL will only ever use 1 index, so when doing queries like this it's important that you define an index which spans the 3 fields. Using your query I would create an index using :
CREATE INDEX ind_BNPINI ON T (B, NPI, NI);
this way MySQL will use the index ind_BNPINI to quickly find all the records.
Take a look at the MySQL manual :- 7.4.5 How MySQL Uses Indexes
[dev.mysql.com...]
I'm relieved that mySQL has turned into a viable alternative so I don't have to continue troubleshooting the dreaded and elusive MS Access 'unspecified error'!
Thanks for the advice.
[edited by: DaveAtIFG at 5:48 am (utc) on July 3, 2004]
[edit reason] Repaired broken link [/edit]