Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Quickest Way To Execute A Query You Know Will Have No Re
Message
De
16/09/2004 13:14:13
 
 
À
16/09/2004 11:39:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00942957
Message ID:
00943010
Vues:
18
Thanks Tore.

>Select ... where .F.
>
>>Hi
>>
>>I have a number of SQL server tables that are related to a parent table. The parent table has bit columns that indicate whether there is any related data in each of the child tables. On the client side, when the parent record is changed, I want to requery the child tables where I know data exists but effectively empty the child cursor(s) where I know there is no data on the SQL server. Obviously, requerying these "known" empty child tables with the apropriate parameter will result in no records being returned. However, SQL server will have to go through the process (and overhead) of querying the table(s) in question simply to find out what we knew ahead of time - there are no records.
>>
>>I am using SQL passthru and my framework makes provision for a dynamic WHERE clause. So, when I know there are no child records (because the parent record bit flag tells me so), I could assign a new WHERE clause of "WHERE 1 = 2". This will return an empty result set and ensure that all bound controls are "empty" and "dimmed" as they should be where their data source is empty.
>>
>>The question is, what kind of overhead reduction (if any) am I likely to get by asking the query to find records "WHERE 1 = 2" rather than looking through the table for records that match the view parameter value when I alread know ahead of the query that they don't exist?
>>
>>Any thoughts would be appreciated.
>>
>>Thanks,
-=Gary
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform