Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Fast Searching
Message
From
05/08/2003 04:43:36
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00816505
Message ID:
00816746
Views:
25
Hi Neil,

>1, There are exactly 2,929,716 records in pdmlog which WILL NOT grow anymore as this is now an archived table.

This is a reference constant table.

2, The maximum possible value for Reccount('temp') will be 1 ALWAYS. There will only be the ability to select 1 record.

Ok, i understand because you don't put temp cursor on the select

3, On the pdmlog there is no index on the mainkey - STRANGE!!!

This is the first problem.

First solution:
....
* ??? SET DELETED off           
* ???? USE ("U:\Data\Pdmlog.dbf") ALIAS Pdmlog 

* ???? LOCAL lclevel, lctype

* ??? lclevel = ' and ' + 'pdmlog.database = thisform.pageframe1.page1.combo1.displayvalue'
* ??? lctype = ' and ' + 'pdmlog.type = thisform.pageframe1.page1.combo2.displayvalue '

PRIVATE keySelected
WITH thisform.pageframe1.page1.List1
  FOR ix=1 TO .Listcount
        IF .Selected[m.ix]
	STORE PADR(.List(m.ix),fsize('mainkey','result')) TO keySelected
	EXIT  && only 1 can selected
        ENDIF
   ENDFOR
ENDWITH
IF VARTYPE('keySelected')='C'
  SELECT user, database, type, date, time FROM U:\Logs\310703\pdmlog.dbf WHERE  mainkey='&keySelected' into cursor crsmatch
 * 1 RECORD ONLY ???, macro is faster for long select
  thisform.pageframe1.page1.grid1.RecordSource =  'crsmatch'
ENDIF
This is a palliative, VFP scan all 2.9XX.XXX for found keySelected occurrences.

The master simple way is to add, to U:\Logs\310703\pdmlog.dbf a INDEX mainkey TAG and open it ( result is immediate if index and table are local file); the best way, for static table is to implement a hashing coding for traslate, but this is not usefull with VFP SELECT.

Now i see "U:\", then U:\Logs\310703\pdmlog.dbf is a remote network table ?

Neil, also INDEX mainkey TAG cannot save you, but it can to be more slower (VFP need to read INDEX and TABLE on the net).

Simple solution is to copy U:\Logs\310703\pdmlog.dbf on local file system,
and index it ( table is costant !).

Another solution for gain time, is:
- INDEX remote table;
- use a ODBC VFP connection, and send SELECT via ODBC;

if this no go well ( i use SQL, and have used VFP ODBC sporadically),
you need to implement a remote application and call it ( hard to implement ).

Note: Use m. prefix for read variables, it is faster and can protect you by strange result.

Fabio
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform