MS Access to Informix Views
Posted in 1996
Topics: SQL Development & Query Writing, Connectivity: ODBC / JDBC / .NET
Here is my problem.
I have about 100 users who are trained in using MS Access 2.0 to query a
Sybase database. We are converting from Sybase to Informix to support
some major applications. I have discovered in testing some of our
queries against the Informix database that the response times are
significantly slower on some queries specifically those where I am
trying to join two or more views. The following example illustrates
this point.
This is the select query created against two TABLE objects and it works
fine:
SELECT tbl_sls_hist.item_no,tbl_sls_hist,inv_date,tbl_prod_item.item_no
FROM tbl_sls_hist, tbl_prod_item WHERE ((tbl_prod_item.item_no =
'L1255') AND (tbl_sls_hist.item_no = tbl_prod_item.item_no))
If we do the same query against two VIEW objects, Access sends the
following two SQL statements to Informix:
SELECT item_no FROM vw_prod_item WHERE (item_no='L1255')
SELECT item_no, inv_date FROM vw_sls_hist
Obviously the join is performed in Access because the result set
eventually ends up being correct. The problem is that vw_sls_hist
returns almost 6,000 records (the entire result of the view) and the
query takes over ten minutes against views instead of 5 to 10 seconds
against the tables.
So far we think we have determined the following:
1. Since MS Access is optimized for Transact-SQL (MS SQL Server), it
will send an appropriately optimized SQL statement to a Transact-SQL
back end (Sybase)
2. Access has problems when querying linked database objects without
indexes (i.e. views) and does not know how to pass the appropriate SQL
statement to Informix to perform the join on the server.
3. This is likely to be the case with any non-Transact-SQL server and
is not a problem with Informix per se.
4. According to Microsoft priority support, there is "nothing we can
do" to influence the way Access parses the query before sending it to
the ODBC driver
5. According to Intersolv (the company whose ODBC driver we are using),
"the basic problem is Access" and "the JetEngine is notorious for
chopping up SQL statements based on some internal criterion". A scan of
the newsgroups supports this statement and the Microsoft TechNet CD does
mention that joins against no indexed linked database objects is not
recommended.
6. According to the Microsoft TechNet CD, Access will query the ODBC
driver for certain capabilities to help it determine the appropriate SQL
statements to send to the ODBC driver. I did not find a list of what
capabilities it is quertying for under what circumstances.
Given the status so far, I would like to know if anyone out there has a
resolution. Two questions I have not been able to answer yet are: Does
the information about the ODBC driver have an impact on how Access
parses the statement?; Are there any hidden settings or configuration
options in Access that may help to resolve this problem?
Thanks
Cory