Quick reply.
Do you have any evidence that this is a bottleneck in practice?
If so, and since this is a relatively small (these days) static file, I would definitely consider copying it to a local drive.
I have a procedure that compares time stamps and updates a local copy whenever they are different.
Peter
>I have a new application that I'm releasing soon and I'm wondering about network performance.
>
>The primary bottleneck will be execution of a single SQL statement that will look much like this (it will be different each time, but this is a reasonable example). This SQL is called for each single form the user looks at.
>
>
Select {some_fields} from SalesSummary ;
>into cursor cBrowse readwrite ;
>;
>Where Between( period, lnFirstPeriod, lnLastPeriod) ;
>And SalesSummary.CustNumber in (Select CustNumber from CustomerSummary;
> where ACustClass in (select Left(DrillValue,20) from cDrillDown where Depth = 1)) ;
>And SalesSummary.CustNumber in (Select CustNumber from CustomerSummary ;
> where ACustID in (select Left(DrillValue,15) from cDrillDown where Depth = 2));
>group by {some_other_fields}
>
>Two questions:
>(1) SalesSummary is a free table on a network. It is skinny (60 bytes) with about 500K records. It also is, in effect, read-only ... it is created hourly elsewhere, and this application merely reads it. Would it be more efficient to copy this file to a local TEMP directory instead of reading it over the network?
>
>(2) Would it be more efficient to eliminate one level of the subqueries, like this?
>
>
Select CustNumber from CustomerSummary;
> where ACustClass in (select Left(DrillValue,20) from cDrillDown where Depth = 1);
> into cursor cTemp1
>
>Select CustNumber from CustomerSummary ;
> where ACustID in (select Left(DrillValue,15) from cDrillDown where Depth = 2);
> into cursor cTemp2
>
>Select {some_fields} from SalesSummary ;
>into cursor cBrowse readwrite ;
>;
>Where Between( period, lnFirstPeriod, lnLastPeriod) ;
>And SalesSummary.CustNumber in (Select * from cTemp1) ;
>And SalesSummary.CustNumber in (Select * from cTemp2 );
>group by {some_other_fields}
Peter Robinson ** Rodes Design ** Virginia