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:

In other words:

Under BDE 4.x there is no noticeable performance slowdown!

REPRODUCING THE PROBLEM

Here are the steps to reproduce the problem:

  1. In your BDE Administrator set Paradox language driver to ascii ansi (DBWINUS0).
  2. 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.
  3. Populate the table with 90000 records. Fill the field values with random values.
  4. 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.
  5. Close the program
  6. The next step is very important: use BDE Administrator again. This time set Paradox language driver to Paradox ANSI Slovene (ansislov).
  7. 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:

  1. You should let the program always to create the table.
  2. 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

Document created: 1998/11/16
Last revised: 2000/06/30

BACK to articles