Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I 'store' querys in a MySQL DB? 2

Status
Not open for further replies.

JustKIDn

MIS
May 6, 2002
386
US
Can I store a query in the DB like you do with tables?

I'm using MySQL as a backend (database) and Access as the frontend (forms, reports, etc...).

I've got a query that runs on MySQL in 1.04 seconds.
The same query (with the table linked into Access) brought Access to it's knees! I let it run for over an hour before I canceled it.

Oh, did I mention that the query has over 30 JOIN's?

Can I store a query in the DB like you do with tables?
tgus

____________________________
Families can be together forever...
 
O.K. Let me rephrase that.

Is there any way to run the query from the server instead of Access?

Or, is there a way to run it as two seperate querys?
So, run the first one and then the second, and append the results together.

Thanks
tgus

____________________________
Families can be together forever...
 
The query is being run on the server -- on a database server, there is no way to get to the information without providing the server with a query it will use to repond with data. The Access engine is doing nothing more than populating GUI fields from data it receives from the ODBC connection.

Your speed problem is probably caused by the slowdown which occurs through the ODBC subsystem query interpretation, the way Mi¢ro$oft handles data interchanges through ODBC, and other factors.

I assume we're talking about a SELECT query here. If so, then you might be able to take the ODBC interchange problem out of the picture by selecting your data to a table, then linking Access to that table through ODBC for viewing. Take a look at the MySQL "INSERT ... SELECT" syntax: Want the best answers? Ask the best questions: TANSTAAFL!
 
I found out that the answer is a 'pass-through' query.
The way it has been explained to me. When you create a pass-through query in Access, it causes the SQL DB to process the query and then return the results tthough the ODBC driver.

My query now runs just as fast in Access as it does in MySQL.
tgus

____________________________
Families can be together forever...
 
Thanks sleipnir,

I just like to share what I've learned so the next person with similar problems can learn from it.

I hate finding posts where the person may have found the answer but didn't share it.
tgus

____________________________
Families can be together forever...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top