Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any way to speed this up
Message
 
 
To
25/01/2005 13:51:02
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
00980402
Message ID:
00980471
Views:
47
Gregory,

UPDATE. After I dropped mmVisCollect, it worked, but is it reliable?

How can I select from the view?

I'm trying
SELECT v_QuickSearch.*, ;
  Employee_queue_schedules.cemployee_queue_schedules_pk, Users.cuserid ;
 FROM mmviscollect!v_QuickSearch ;
    INNER JOIN mmVisCollect!Trans_employees_queues ;
    ON v_QuickSearch.cTrans_PK = Trans_employees_queues.ctrans_fk ;     
    INNER JOIN mmviscollect!usgrlink ;
   ON  Trans_employees_queues.ccommission_owner_usgrlink_fk = Usgrlink.cusgrlink_pk ;
    INNER JOIN mmviscollect!employee_queue_schedules ;
   ON  Trans_employees_queues.ctrans_employees_queues_pk = Employee_queue_schedules.ctrans_employees_queues_fk ;
    INNER JOIN mmviscollect!users ;
   ON  Users.iid = Usgrlink.iuserid;
 WHERE Trans_employees_queues.iactive_flag =  1 ;
 	   AND  Employee_queue_schedules.iactive_flag =  1 ;
 	   INTO CURSOR cTempResult
but it tries to find this table v_QuickSearch

>>>Nadya,
>>>
>>>I've found out that requery() of a (complex ?) view that retrieves just one record takes time. If you multiply that with the number of records in the scan ...
>>>It may save time to
>>>
>>>    select ..... ;
>>>       from ScanCursor, table1, ......
>>>       [ or join ]
>>>       [ or where clause ]
>>>      into cursor (c_QuickSearch)
>>>
>>>
>>>Could you do with just one (complex ?) select into (c_QuickSearch) ?
>>>Should be fast if you have the proper indexes
>>>
>>>Sometimes it saves time to break down a complex sql statement into a couple of simpler sql statements
>>>
>>>&& first select from the table with the highest number of records, if you have a choice in your navigation route
>>>select ... ;
>>>   from ScanCursor, Table1 ;
>>>   where
>>>   into cursor subset1
>>>
>>>&& if the subsets are hughe, it helps sometimes to index a subset and then carry on with the next select
>>>select ... ;
>>>   from subset1, table2 ;
>>>   where ...
>>>   into susbset2
>>>
>>>...
>>>
>>>select ... ;
>>>   from subsetN, table x ;
>>>   into cursor (c_QuickSearch) ;
>>>   order by ....
>>>
>>>
>>>
>>>You need to experiment a bit
>>>
>>>Oh, and only select the fields you need
>>
>>Ok, I'll experiment. Right now it takes 3 sec. for 85 records instead of 14. Still quite long.
>
>
>Build it one step at a time and try to improve time and performance of each step. Go only to the next step when you feel that the current step cannot be optimized any more
>
>
>&& (1)
>select ....
>    from ScanCursor, Table1 ;
>    where
>
>&& check rushmore sys(3054) (with set deleted off)
>
>&& (2)
>select ....
>    from ScanCursor, Table1, Table2 ;
>    where
>
>&& check rushmore sys(3054)
>
>
>&& (3)
>select ....
>    from ScanCursor, Table1, Table2, Table3 ;
>    where
>
>&& check rushmore sys(3054)
>
>etc
>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform