BACK to articles
BDE 5 and LANGUAGE DRIVERS - BIG PERFORMANCE SLOWDOWN ON QUERIES
by Miha Remec
PROBLEM DESCRIPTION
Running queries with BDE 5 on local Paradox tables with string fields is much slower than it was with BDE 4.x.
The problem arises under following conditions:
- table is created using international language driver (different than
ascii ansi)
- there is at least one string field in the table
- those string fields are included in SQL query
In other words:
- When table is CREATED with DBWINUS0 language driver ('ascii' ansi), the query performance is acceptable.
- When table is CREATED with other language driver (I've used Paradox ANSI Slovene), the query performance goes significantly down.
Under BDE 4.x there is no noticeable performance slowdown!
REPRODUCING THE PROBLEM
Here are the steps to reproduce the problem:
- In your BDE Administrator set Paradox language driver to ascii ansi (DBWINUS0).
- Create a local Paradox table (myTable.db) with the following structure:
FIELD1 A 2
FIELD2 A 2
FIELD3 N
Note: the table will be created using ascii ansi Paradox language driver.
- Populate the table with 90000 records. Fill the field values with random values.
- Execute SQL query on this table:
SELECT FIELD1, FIELD2, SUM(FIELD3)
FROM myTable
GROUP BY FIELD1, FIELD2
Note: The query itself needs about 3 seconds to complete.
- Close the program
- The next step is very important: use BDE Administrator again. This time set Paradox language driver to Paradox ANSI Slovene (ansislov).
- repeat steps 2 - 5
Note: this time, the table will be created using Paradox ANSI Slovene language driver.
Note: Now the query will need 20 times more than previous query to complete (in my case, about 60 seconds).
You can download the source code for this program: BDEBug.dpr.
Try it (less than 100 lines of source code!) and build it on your local machine. The program creates a table, adds 90000 records and executes a query. It also reports elapsed time.
Important:
- You should let the program always to create the table.
- The problem is language driver (LD) in the _time_of_creating_the_table_, not in the time when querying the table.
If you are still not convinced, switch your BDE back to 4.X and run the program again.
MY COMPUTER CONFIGURATION
HW info: P266, 64MB RAM
SW info: WinNT4/SP3, Delphi 4.02
BDE info: v5.01
- Paradox driver:
NET DIR: point to some local dir, e.g. C:\TEMP
LANGDRIVER: <THIS IS WHAT'S CAUSING TROUBLES>
BLOCKSIZE: 4096
FILL FACTOR: 95
LEVEL: 7
- SYSTEM\INIT
LANGDRIVER: Pdox ANSI Slovene (but can be any name)
LOCAL SHARE: false
MAXBUFSIZE: 8192
MAXFILEHANDLES: 96
Document created: 1998/11/16
Last revised: 2000/06/30
BACK to articles
Copyright © 1996-2000 by Miha Remec