Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimizing a view
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Optimizing a view
Miscellaneous
Thread ID:
00058191
Message ID:
00058191
Views:
67
I built a view with the view builder, combining table1 and table2, and filtering as follows: table1.group is a character field that can be 'a', 'b', or 'c'. The user will choose to include all 'a' and all 'b' and exclude 'c', or vice versa. To make the query work, I made public variables (eventually to become app object properties) group1 and group2. If the user chooses 'a and b', I set group1 = 'a' and group2 = 'b'. If group 'c' is chosen, I set both group1 and group2 = 'c'. Group1 and group2 are also query parameters. The query looks like this:

SELECT table1.orderfield, table1.group, table1.field1, ... ,table1.field5, table2.field1, ..., table2.field8, table2.memofield, table2.key, table2.field9,...table2.field50 FROM mydata!table1,mydata!table2 WHERE table1.key = table2.key AND (table1.group = ?group1 OR (table1.group = ?group2)) ORDER BY table1.orderfield

Table1 has 6000 records and is 2.5MB with a 0.5MB .cdx. Table2 has 2300 records and is 5.2 MB with a 94 KB .cdx and a 78 KB .fpt. I have indexes on table1 key, orderfield, group, and DELETED(), and table2 key and DELETED(). If 'a and b' is chosen, the query takes 16-22 seconds, running on a P166 off a network drive. If 'c' is chosen, it takes about 10 seconds. Could I do anything to speed this up?
Next
Reply
Map
View

Click here to load this message in the networking platform