Page 64 of 70

Re: ADO RDD xHarbour

PostPosted: Mon Nov 02, 2015 7:30 pm
by AHF
Gunther,

Great! Im glad to know :D

A practice suggestion:
In ADOPREOPENTHRESHOLD() not only the size in records should work as a filter. Also a substring (or a array with substrings) of the tablename are interesting for filtering the DBs for pre-open! (ex. only "2015" -> DB2015 and Faw2015gt and Klima2015 and ......)


Note taken Ill see what can be done.

Could you share your experience ?

Time of conversion of the app
Any app code changed ? Why?

Db engine used
Database size
Average table size (nr of rows)
Biggest table size (nr of rows)
Lan and / or Wan
Nr of users
Concurrent use (new additions by others) and locking

Does app use ?
Relations
Scopes
Filters
Indexes with UDFs
Locks
Transactions

do you use ado or sql directly through for example adofuncs.prg or any class and does adordd catch well eventually new additions by those processes?

Overall performance compared to others rdds 1 to 5 (1 being the slowest)

Is it in production?

Thanks

Re: ADO RDD xHarbour

PostPosted: Tue Nov 03, 2015 9:25 am
by byte-one
Antonio, before i test my app with ca. 60 DBs with your ADORDD i must change some field-names (ex. CHECK or SCHEMA) as they are not allowed in SQL.
I use MSSQL. In my tests indices with UDFs should be avoided (>1000 records). The fastest way is to use only full fieldnames for indexkey. There are some DB-changes recommendable.
For future i will report you all my experiences!

Re: ADO RDD xHarbour

PostPosted: Tue Nov 03, 2015 11:03 am
by AHF
Gunther,

The tests Ive made with Mysql and reserved keywords as field name its working ok.

You cant use those keywords in triggers, procedures functions etc but should be ok as field names as they are special quoted in all expressions.

Please try it because I think you dont need to do anything.

I use MSSQL. In my tests indices with UDFs should be avoided (>1000 records)


I tried it in Mysql with 1000 and its slower but still ok.

Can you post some examples of such UDFs?

For future i will report you all my experiences!


Thanks.

Re: ADO RDD xHarbour

PostPosted: Tue Nov 03, 2015 1:25 pm
by byte-one
MSSQL-Server native errors 102 or 156: Incorrect syntax near the keyword 'BIT', Incorrect syntax near the keyword 'SCHEMA'. I use SCHEMA and CHECK as fieldnames -> not allowed!

Re: ADO RDD xHarbour

PostPosted: Tue Nov 03, 2015 1:38 pm
by AHF
Gunther,

I forgot to have it done to MSSQL.

Place this line in ADOQUOTEDCOLSQL in CASE dbEngine = "MSSQL"

cCol := "`" + cCol + "`"

if it doesnt work try

cCol := '[' + cCol + ']'

Should work now.

Re: ADO RDD xHarbour

PostPosted: Tue Nov 03, 2015 6:40 pm
by byte-one
OK now []! Thanks.

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 10:23 am
by byte-one
Antonio, I found, that when the eof() reached no further operations in this table are possible! I must use GO TOP in this case and then the table is reachable again!
(MSSQL)

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 11:05 am
by AHF
Gunther,

Im not using MSSQL Im using MySql and its ok.

Can you post code example ?

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 11:48 am
by byte-one
After
Code: Select all  Expand view
dbgoto(lastrec()+1))
is no dbseek() possible (records to found are present)! Or after a dbseek() with no result another dbseek() are not possible.
If the searched value is not found, DbSeek() positions the record pointer on the "ghost record" (Lastrec()+1) by default, and the function Found() returns .F. (false), while Eof() returns .T. (true).

I think this "ghost record" is the reason!?

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 12:11 pm
by AHF
Gunther,

Here its ok.
My test:

Code: Select all  Expand view

use table
set index to someindex
dbgoto(lastrec()+1) //record not found goes eof
seek "      1/99" //if recordset not empty goes first and find OK
browse()  
dbgobottom()
skip 1
msginfo(cvaltochar(eof())+" "+cvaltochar(recno()) )
skip -1
msginfo(cvaltochar(eof())+" "+cvaltochar(recno()) )
skip -1
msginfo(cvaltochar(eof())+" "+cvaltochar(recno()) )
 


Do you have any scopes and/or filters?

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 12:52 pm
by AHF
Gunther,

The SELECT used in adoreccount if im not mistaken supplied by you its the only difference between MySql and MsSQL.

Try to change ti to SELECT MAX(... and check results.

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 1:10 pm
by byte-one
Now i found out:
If i use TESTADISC->(dbsetorder(1)) and the indexkey of this order is UDF then the seek is not functioning! If i use after dbsetorder() a GO TOP then is functioning!

Code: Select all  Expand view
SET ADODBF TABLES INDEX LIST TO { {"AW2015",{"REV",'REV2TO2(REDATUM)'},{"RR","bu_korrindex(redatum,ideingdat)"},{"EW",'REV2TO2(REDATUM)'} } }
SET ADO INDEX UDFS TO {"IF","&","SUBSTR","SUBS","==","REV2TO2","REVEING","BU_KORRINDEX"}

TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))    //damit keine anzeige
TESTADISC->(dbsetorder(1))
//  GO TOP
TESTADISC->(dbseek("0227"))
 Browse()

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 2:46 pm
by AHF
Gunther,

Is this still true if you comment
Code: Select all  Expand view
TESTADISC->(dbgoto(TESTADISC->(lastrec()+1)))    //damit keine anzeige
?

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 2:57 pm
by AHF
Gunther,

I think Ive got it.

Change the line in ado_seek.

Code: Select all  Expand view

  ELSE //WITH :FILTER OR MOE THAN ONE FIELD
      IF !EMPTY( oRecordSet:Filter )
         IF lSoftSeek
            nPos := ASCAN( aWAData[ WA_ABOOKMARKS ][aWAData[WA_INDEXACTIVE]],;
                     {|x|  IF( VALTYPE( x[ 2 ] )= "C",SUBSTR( x[ 2 ], 1, LEN( cKey ) ) = cKey ,;
                                x[ 2 ] = cKey   )} )

            IF nPos = 0 // oRs:Eof() //!lFindLast     <========
 


Is it working ?

Re: ADO RDD xHarbour

PostPosted: Thu Nov 05, 2015 3:08 pm
by byte-one
Antonio, no working! This is only for softseek!?