Thursday, March 8, 2012

ADP vs. MDB: Speed

I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL
7 back end. The view is scrolling very slowly. However, if I open the view
in an ADP file, it scrolls quickly.
I needed to use an ODBC link for the view because it needs to be editable.
Otherwise, I would have used a pass-through query.
In previous discussions about using an MDB file vs. an ADP file as a front
end for SQL Server, the impression I got was that both were about the same,
but that the MDB was a more mature technology and less problematic than the
ADP technology. However, the speed difference I'm noticing with the ADP file
in regards to this view is significant and is very disconcerting re. using
an MDB file.
Any thoughts/comments/suggestions would be appreciated. I've reproduced the
view's SQL below for reference.
Thanks,
Neil
SQL for view in question:
SELECT INVTRY.[Index], INVTRY.TITLE, INVTRY.AUTHILL1,
INVTRY.attFirstEdition, INVTRY.attSigned,
ISNULL(INVTRY.attSignedPD, ' ') SignedCond, INVTRY.YRPUB,
INVTRY.PRICE, INVTRY.Web, INVTRY.Status,
INVTRY.WebStatusPending, INVTRY.ActivateDate,
INVTRY.DeactivateDate, INVTRY.WebAddedBatchID,
INVTRY.AllowDuplicate, INVTRY.WebAction,
INVTRY.WebActionPending, INVTRY.DateModified,
INVTRY.DateWebActionApplied, INVTRY.JIT, INVTRY.MImage,
INVTRY.HImage, INVTRY.AdCode,
CASE WHEN INVTRY.WebAddedBatchID IS NOT NULL
THEN - 1 ELSE 0 END AS OnWeb
FROM vwInventory_Dupes INNER JOIN
(WebStatus INNER JOIN
(INVTRY INNER JOIN
tabStatus ON INVTRY.Status = tabStatus.Status) ON
WebStatus.WebStatus = INVTRY.Web) ON
(vwInventory_Dupes.YearPub = INVTRY.YRPUB) AND
(vwInventory_Dupes.SignedCond = ISNULL(INVTRY.attSignedPD,
' ')) AND (vwInventory_Dupes.Signed = INVTRY.attSigned) AND
(vwInventory_Dupes.FirstEd = INVTRY.attFirstEdition) AND
(vwInventory_Dupes.Author = INVTRY.AUTHILL1) AND
(vwInventory_Dupes.TITLE = INVTRY.TITLE)
WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)
= 1))
SQL for vwInventory_Dupes, used as subquery:
SELECT INVTRY.TITLE, INVTRY.AUTHILL1 Author,
Cast(attFirstEdition AS tinyint) FirstEd,
Cast(attSigned AS tinyint) Signed,
ISNULL(INVTRY.attSignedPD, ' ') SignedCond,
INVTRY.YRPUB YearPub
FROM WebStatus INNER JOIN
(INVTRY INNER JOIN
tabStatus ON INVTRY.Status = tabStatus.Status) ON
WebStatus.WebStatus = INVTRY.Web
WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)
= 1))
GROUP BY INVTRY.TITLE, INVTRY.AUTHILL1,
Cast(attFirstEdition AS tinyint), Cast(attSigned AS tinyint),
ISNULL(INVTRY.attSignedPD, ' '), INVTRY.YRPUB
HAVING (((COUNT(INVTRY.[INDEX])) > 1))
The ways ADPs and MDBs use recordsets are very different, so sometimes one or
the other will be faster.
By default, the MDB opens a Dynaset which means it first opens a connection to
grab the list of keys for the records, then reads the actual records as needed
for display by doing individual selects of 10 records aby explicit key. This
can help speed when each row has a lot of data because only the rows that are
actually viewd will be read, not all of them. On the other hand, if the table
has a very large number of rows, Access will spend a lot of time in the
background reading the whole list of keys, and if the key lookup for each row
is slow for some reason, everything will be sluggish.
An ADP, a static recordset is normally used, and an absolute cap of 10,000
rows is applied, so if your recordset has more than that, you just won't get
all the rows. Static means in loads all the data at once, then you browse
through it in memeory. That's very fast once you load the data, but if each
row has a lot of data, especially memo fields and such, it can take a long
time to initially load.
On Sun, 20 Mar 2005 08:31:48 GMT, "Neil" <njones@.pxdy.com> wrote:

>I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL
>7 back end. The view is scrolling very slowly. However, if I open the view
>in an ADP file, it scrolls quickly.
>I needed to use an ODBC link for the view because it needs to be editable.
>Otherwise, I would have used a pass-through query.
>In previous discussions about using an MDB file vs. an ADP file as a front
>end for SQL Server, the impression I got was that both were about the same,
>but that the MDB was a more mature technology and less problematic than the
>ADP technology. However, the speed difference I'm noticing with the ADP file
>in regards to this view is significant and is very disconcerting re. using
>an MDB file.
>Any thoughts/comments/suggestions would be appreciated. I've reproduced the
>view's SQL below for reference.
>Thanks,
>Neil
>SQL for view in question:
>SELECT INVTRY.[Index], INVTRY.TITLE, INVTRY.AUTHILL1,
> INVTRY.attFirstEdition, INVTRY.attSigned,
> ISNULL(INVTRY.attSignedPD, ' ') SignedCond, INVTRY.YRPUB,
> INVTRY.PRICE, INVTRY.Web, INVTRY.Status,
> INVTRY.WebStatusPending, INVTRY.ActivateDate,
> INVTRY.DeactivateDate, INVTRY.WebAddedBatchID,
> INVTRY.AllowDuplicate, INVTRY.WebAction,
> INVTRY.WebActionPending, INVTRY.DateModified,
> INVTRY.DateWebActionApplied, INVTRY.JIT, INVTRY.MImage,
> INVTRY.HImage, INVTRY.AdCode,
> CASE WHEN INVTRY.WebAddedBatchID IS NOT NULL
> THEN - 1 ELSE 0 END AS OnWeb
>FROM vwInventory_Dupes INNER JOIN
> (WebStatus INNER JOIN
> (INVTRY INNER JOIN
> tabStatus ON INVTRY.Status = tabStatus.Status) ON
> WebStatus.WebStatus = INVTRY.Web) ON
> (vwInventory_Dupes.YearPub = INVTRY.YRPUB) AND
> (vwInventory_Dupes.SignedCond = ISNULL(INVTRY.attSignedPD,
> ' ')) AND (vwInventory_Dupes.Signed = INVTRY.attSigned) AND
> (vwInventory_Dupes.FirstEd = INVTRY.attFirstEdition) AND
> (vwInventory_Dupes.Author = INVTRY.AUTHILL1) AND
> (vwInventory_Dupes.TITLE = INVTRY.TITLE)
>WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)
> = 1))
>SQL for vwInventory_Dupes, used as subquery:
>SELECT INVTRY.TITLE, INVTRY.AUTHILL1 Author,
> Cast(attFirstEdition AS tinyint) FirstEd,
> Cast(attSigned AS tinyint) Signed,
> ISNULL(INVTRY.attSignedPD, ' ') SignedCond,
> INVTRY.YRPUB YearPub
>FROM WebStatus INNER JOIN
> (INVTRY INNER JOIN
> tabStatus ON INVTRY.Status = tabStatus.Status) ON
> WebStatus.WebStatus = INVTRY.Web
>WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)
> = 1))
>GROUP BY INVTRY.TITLE, INVTRY.AUTHILL1,
> Cast(attFirstEdition AS tinyint), Cast(attSigned AS tinyint),
> ISNULL(INVTRY.attSignedPD, ' '), INVTRY.YRPUB
>HAVING (((COUNT(INVTRY.[INDEX])) > 1))
>
|||You may try to add a virtual index on your linked view:
http://support.microsoft.com/kb/q209123/
If this doesn't help, then you will have to use an unbound form coupled with
SQL pass-through queries (or ADO objects) to resolve your speed problem with
MDB. Another solution could be to go with TS to simulate a high-speed LAN.
I don't know where you got the impression that MDB were about the same as
ADP in term of speed. It has been repeated a number of times that the use
of MDB' linked tables and views is only a workable solution for small
databases on a fast Lan.
S. L.
"Neil" <njones@.pxdy.com> wrote in message
news:Uxa%d.15606$cN6.15135@.newsread1.news.pas.eart hlink.net...
>I have a situation with an ODBC linked view in an Access 2000 MDB with a
>SQL 7 back end. The view is scrolling very slowly. However, if I open the
>view in an ADP file, it scrolls quickly.
> I needed to use an ODBC link for the view because it needs to be editable.
> Otherwise, I would have used a pass-through query.
> In previous discussions about using an MDB file vs. an ADP file as a front
> end for SQL Server, the impression I got was that both were about the
> same, but that the MDB was a more mature technology and less problematic
> than the ADP technology. However, the speed difference I'm noticing with
> the ADP file in regards to this view is significant and is very
> disconcerting re. using an MDB file.
> Any thoughts/comments/suggestions would be appreciated. I've reproduced
> the view's SQL below for reference.
> Thanks,
> Neil
> SQL for view in question:
> SELECT INVTRY.[Index], INVTRY.TITLE, INVTRY.AUTHILL1,
> INVTRY.attFirstEdition, INVTRY.attSigned,
> ISNULL(INVTRY.attSignedPD, ' ') SignedCond, INVTRY.YRPUB,
> INVTRY.PRICE, INVTRY.Web, INVTRY.Status,
> INVTRY.WebStatusPending, INVTRY.ActivateDate,
> INVTRY.DeactivateDate, INVTRY.WebAddedBatchID,
> INVTRY.AllowDuplicate, INVTRY.WebAction,
> INVTRY.WebActionPending, INVTRY.DateModified,
> INVTRY.DateWebActionApplied, INVTRY.JIT, INVTRY.MImage,
> INVTRY.HImage, INVTRY.AdCode,
> CASE WHEN INVTRY.WebAddedBatchID IS NOT NULL
> THEN - 1 ELSE 0 END AS OnWeb
> FROM vwInventory_Dupes INNER JOIN
> (WebStatus INNER JOIN
> (INVTRY INNER JOIN
> tabStatus ON INVTRY.Status = tabStatus.Status) ON
> WebStatus.WebStatus = INVTRY.Web) ON
> (vwInventory_Dupes.YearPub = INVTRY.YRPUB) AND
> (vwInventory_Dupes.SignedCond = ISNULL(INVTRY.attSignedPD,
> ' ')) AND (vwInventory_Dupes.Signed = INVTRY.attSigned) AND
> (vwInventory_Dupes.FirstEd = INVTRY.attFirstEdition) AND
> (vwInventory_Dupes.Author = INVTRY.AUTHILL1) AND
> (vwInventory_Dupes.TITLE = INVTRY.TITLE)
> WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)
> = 1))
> SQL for vwInventory_Dupes, used as subquery:
> SELECT INVTRY.TITLE, INVTRY.AUTHILL1 Author,
> Cast(attFirstEdition AS tinyint) FirstEd,
> Cast(attSigned AS tinyint) Signed,
> ISNULL(INVTRY.attSignedPD, ' ') SignedCond,
> INVTRY.YRPUB YearPub
> FROM WebStatus INNER JOIN
> (INVTRY INNER JOIN
> tabStatus ON INVTRY.Status = tabStatus.Status) ON
> WebStatus.WebStatus = INVTRY.Web
> WHERE (((tabStatus.ForWeb) = 1) AND ((WebStatus.IncludeDupe)
> = 1))
> GROUP BY INVTRY.TITLE, INVTRY.AUTHILL1,
> Cast(attFirstEdition AS tinyint), Cast(attSigned AS tinyint),
> ISNULL(INVTRY.attSignedPD, ' '), INVTRY.YRPUB
> HAVING (((COUNT(INVTRY.[INDEX])) > 1))
>
|||On Sun, 20 Mar 2005 12:32:10 -0500, "Sylvain Lafontaine" <sylvain aei ca (fill
the blanks, no spam please)> wrote:

>You may try to add a virtual index on your linked view:
>http://support.microsoft.com/kb/q209123/
>If this doesn't help, then you will have to use an unbound form coupled with
>SQL pass-through queries (or ADO objects) to resolve your speed problem with
>MDB. Another solution could be to go with TS to simulate a high-speed LAN.
>I don't know where you got the impression that MDB were about the same as
>ADP in term of speed. It has been repeated a number of times that the use
>of MDB' linked tables and views is only a workable solution for small
>databases on a fast Lan.
Frankly, I find that statement ludicrous. Many developers including myself
have had excelent results using MDBs as front-ends to various kinds of SQL
Server back-end for many years before there was such a thing as an ADP. When
MDBs are slow, the workarounds to fix it are far less arduous than the
workarounds required in ADPs to simply make them function in many cases.
|||The view in question only returns 1154 rows. So we're not talking a large
number here. And only returning 24 fields.
There was a modification recently where three additional fields were added
to the view, and that seemed to slow things down significantly. I'm not sure
if there's some boundary at around 24 fields, or if something else is going
on. But the linked view is *very* slow, taking several seconds just to bring
up the first screen, and then, whenever the scroll bar goes down by one,
several more seconds just to refresh. The ADP view, on the other hand, is
fast, with no delay at all, either in bringing up the data or in scrolling.
Neil
"Steve Jorgensen" <nospam@.nospam.nospam> wrote in message
news:kq9r31tdjl3tv8v10kourkov1psurko5ug@.4ax.com...
> The ways ADPs and MDBs use recordsets are very different, so sometimes one
> or
> the other will be faster.
> By default, the MDB opens a Dynaset which means it first opens a
> connection to
> grab the list of keys for the records, then reads the actual records as
> needed
> for display by doing individual selects of 10 records aby explicit key.
> This
> can help speed when each row has a lot of data because only the rows that
> are
> actually viewd will be read, not all of them. On the other hand, if the
> table
> has a very large number of rows, Access will spend a lot of time in the
> background reading the whole list of keys, and if the key lookup for each
> row
> is slow for some reason, everything will be sluggish.
> An ADP, a static recordset is normally used, and an absolute cap of 10,000
> rows is applied, so if your recordset has more than that, you just won't
> get
> all the rows. Static means in loads all the data at once, then you browse
> through it in memeory. That's very fast once you load the data, but if
> each
> row has a lot of data, especially memo fields and such, it can take a long
> time to initially load.
> On Sun, 20 Mar 2005 08:31:48 GMT, "Neil" <njones@.pxdy.com> wrote:
>
|||> You may try to add a virtual index on your linked view:
> http://support.microsoft.com/kb/q209123/
Yes, these are added when you first attach the view or table. When the
object doesn't have a primary key (as with views) Access prompts you for
which field(s) to use as pk. It then stores that information. You can't
update the data otherwise. So it's already there.

> If this doesn't help, then you will have to use an unbound form coupled
> with SQL pass-through queries (or ADO objects) to resolve your speed
> problem with MDB.
As noted, the reason for not using pass-through is because it needs to be
updatable.

>Another solution could be to go with TS to simulate a high-speed LAN.
What is "TS"?

> I don't know where you got the impression that MDB were about the same as
> ADP in term of speed. It has been repeated a number of times that the use
> of MDB' linked tables and views is only a workable solution for small
> databases on a fast Lan.
From discussions in this newsgroup.
Neil

> S. L.
> "Neil" <njones@.pxdy.com> wrote in message
> news:Uxa%d.15606$cN6.15135@.newsread1.news.pas.eart hlink.net...
>
|||TS = Terminal Server; you can also use Citrix. This is a quick fix for
getting a multi-user access to an Access' MDB file over the Internet or to
solve the possibility of corruption when you LAN network is not rock solid.
However, this solution come with a price ($).
With the use of unbound forms as the solution, you are responsible for
sending the modifications to the data back to the database. This will give
you the possibility to use the result of a read-only SQL pass-through in a
form but, obviously, with the obligation of having more coding work to be
done. Of course, some of this work can be partially automated. You will
find more information on that subject on books dealing with Access and
SQL-Server. (Personally, I prefer to use ADP but it has many bugs.)
By using the profiler on the SQL-Server, it is also possible that you will
see something that will give you the possibility of resolving the speed
problem of you linked views by having a better understanding of what Access
is doing when it communicates with the server.
S. L.
"Neil" <njones@.pxdy.com> wrote in message
news:FCk%d.633$H06.566@.newsread3.news.pas.earthlin k.net...
> Yes, these are added when you first attach the view or table. When the
> object doesn't have a primary key (as with views) Access prompts you for
> which field(s) to use as pk. It then stores that information. You can't
> update the data otherwise. So it's already there.
>
> As noted, the reason for not using pass-through is because it needs to be
> updatable.
>
> What is "TS"?
>
> From discussions in this newsgroup.
> Neil
>
>
|||Are you talking about the WAN or a LAN?
In the case of the WAN, all tests that I have done in the past indicate that
MDB files are much slower to access a SQL-Server backend. The use of linked
views will greatly reduce the performance hit but even with them, I don't
see the benefice of creating hundred of views instead of creating hundred of
stored procedures. If you want to get some decent speed over the internet,
there are a lot more of work to do using MDB than using ADP and even then,
I'm not really sure if the use of linked views will achieve the same level
of performance.
You are entitled to your opinion but all the tests that I have done in the
past clearly indicate that the use of MDB to access a SQL-Server over the
internet is only, at its best, a kludge.
For a LAN, the problem is of course much less severe but at the condition
that the network is not already overcrowded.
S. L.
"Steve Jorgensen" <nospam@.nospam.nospam> wrote in message
news:vvgr31l3buv11blqbv3utfk22uhgoa3vab@.4ax.com...
> On Sun, 20 Mar 2005 12:32:10 -0500, "Sylvain Lafontaine" <sylvain aei ca
> (fill
> the blanks, no spam please)> wrote:
>
> Frankly, I find that statement ludicrous. Many developers including
> myself
> have had excelent results using MDBs as front-ends to various kinds of SQL
> Server back-end for many years before there was such a thing as an ADP.
> When
> MDBs are slow, the workarounds to fix it are far less arduous than the
> workarounds required in ADPs to simply make them function in many cases.
>
|||Did you specify a field or set of fields to be used as the primary key for the
view when you created the link? If not, it will be slower, and will not be
updateable.
On Sun, 20 Mar 2005 19:58:33 GMT, "Neil" <njones@.pxdy.com> wrote:

>The view in question only returns 1154 rows. So we're not talking a large
>number here. And only returning 24 fields.
>There was a modification recently where three additional fields were added
>to the view, and that seemed to slow things down significantly. I'm not sure
>if there's some boundary at around 24 fields, or if something else is going
>on. But the linked view is *very* slow, taking several seconds just to bring
>up the first screen, and then, whenever the scroll bar goes down by one,
>several more seconds just to refresh. The ADP view, on the other hand, is
>fast, with no delay at all, either in bringing up the data or in scrolling.
>Neil
>
>"Steve Jorgensen" <nospam@.nospam.nospam> wrote in message
>news:kq9r31tdjl3tv8v10kourkov1psurko5ug@.4ax.com.. .
>
|||Well, perhaps the reason for our difference of opinion is that I never thought
it was particularly appropriate to connect directly to a database server
across a WAN at all. I usually recommend using a terminal server or rewriting
the app as a Web application or some other kind of 3-tier application.
On Sun, 20 Mar 2005 16:49:55 -0500, "Sylvain Lafontaine" <sylvain aei ca (fill
the blanks, no spam please)> wrote:

>Are you talking about the WAN or a LAN?
>In the case of the WAN, all tests that I have done in the past indicate that
>MDB files are much slower to access a SQL-Server backend. The use of linked
>views will greatly reduce the performance hit but even with them, I don't
>see the benefice of creating hundred of views instead of creating hundred of
>stored procedures. If you want to get some decent speed over the internet,
>there are a lot more of work to do using MDB than using ADP and even then,
>I'm not really sure if the use of linked views will achieve the same level
>of performance.
>You are entitled to your opinion but all the tests that I have done in the
>past clearly indicate that the use of MDB to access a SQL-Server over the
>internet is only, at its best, a kludge.
>For a LAN, the problem is of course much less severe but at the condition
>that the network is not already overcrowded.
>S. L.
>"Steve Jorgensen" <nospam@.nospam.nospam> wrote in message
>news:vvgr31l3buv11blqbv3utfk22uhgoa3vab@.4ax.com.. .
>

No comments:

Post a Comment