================================================================================ SQL statement (Executed with 4.24 Build 1) ================================================================================ select * from debttran where amount between 2000 and 2100 Tables Involved --------------- debttran (debttran) table opened shared, has 54554 rows Result Set Generation --------------------- Result set will be live Result set will consist of one or more rows Result set will be ordered by the primary index for the table debttran WHERE Clause Execution ---------------------- The expression: amount between 2000 AND 2100 is UN-OPTIMIZED, covers 54554 rows or index keys, costs 24440192 bytes, and will be applied to the debttran table (debttran) before any joins ================================================================================ >>>>> 716 rows affected in 1.063 seconds ================================================================================ structure: unit debttran-struc; interface procedure CreateTables(CreateDatabaseName: string); implementation {$IFDEF VER170} uses Forms, Classes, DB, DBISAMTb, SysUtils, Variants; {$ENDIF} {$IFDEF VER150} uses Forms, Classes, DB, DBISAMTb, SysUtils, Variants; {$ENDIF} {$IFDEF VER140} uses Forms, Classes, DB, DBISAMTb, SysUtils, Variants; {$ENDIF} {$IFDEF VER130} uses Forms, Classes, DB, DBISAMTb, SysUtils; {$ENDIF} procedure CreateTables(CreateDatabaseName: string); var TableToCreate: TDBISAMTable; begin TableToCreate:=TDBISAMTable.Create(Application); try with TableToCreate do begin DatabaseName:=CreateDatabaseName; TableName:='debttran'; Exclusive:=True; if (not Exists) then begin with FieldDefs do begin Clear; Add('NUMBER',ftAutoInc); Add('ACCOUNT',ftString,15); Add('DATE',ftDate); Add('REFERENCE',ftString,30); Add('ORDERNUMBER',ftString,15); Add('BRANCH',ftString,3); Add('DBRANCH',ftString,5); Add('AMOUNT',ftCurrency); Add('CURRENCY',ftString,3); Add('CURRENCYRATE',ftFloat); Add('DEBIT',ftCurrency); Add('CREDIT',ftCurrency); Add('PROFIT',ftCurrency); Add('TAX',ftCurrency); Add('AMOUNT_DUE',ftCurrency); Add('PAIDUP',ftBoolean); Add('REP',ftInteger); Add('DC',ftString,1); Add('AGE',ftInteger); Add('USER',ftInteger); Add('TAXABLE',ftCurrency); Add('GLAUDIT',ftInteger); Add('UNIQUE',ftInteger); Add('TAX_IND',ftInteger); Add('TAX_RATE',ftCurrency); Add('CODE',ftString,2); Add('ISINVOICE',ftBoolean); Add('LEDGER',ftString,15); Add('MUSTPRINT',ftString,1); Add('DELIVERYNOTE',ftString,15); Add('COMMENT',ftString,30); Add('DUEDATE',ftDate); Add('PAIDDATE',ftDate); Add('EVALRATE',ftFloat); Add('EVALDATE',ftDateTime); Add('PAYREFERENCE',ftString,15); Add('AGED',ftBoolean); Add('SALENUMBER',ftInteger); Add('TILLNUMBER',ftInteger); Add('CREATED',ftDateTime); Add('MODIFIED',ftDateTime); Add('ISSELECTED',ftBoolean); Add('LINKACCOUNT',ftString,15); Add('DiscStatus',ftBoolean); Add('STATUS',ftInteger); Add('SSTATUS',ftBoolean); Add('PSTATUS',ftInteger); Add('CHEQUENO',ftInteger); Add('TRANSFERNO',ftInteger); Add('DOCDATE',ftDate); Add('COMMPERC',ftFloat); end; with IndexDefs do begin Clear; Add('','NUMBER',[ixPrimary,ixUnique]); Add('ACCOUNT','ACCOUNT;DATE'); Add('DATE','DATE'); Add('REFERENCE','REFERENCE',[ixCaseInsensitive]); Add('CODE','CODE'); Add('STATUS','ACCOUNT;STATUS'); Add('DC','DC'); Add('ALLOC','ACCOUNT;DC;SSTATUS;DATE'); Add('LINKACCOUNT','ACCOUNT;LINKACCOUNT;DATE'); end; CreateTable(0,1,0,False,'','',4096,512,0) end; end; finally TableToCreate.Free; end; end; end.