Subject Re: [firebird-support] Re: Is ESQL Faster than Dynamic SQL.
Author Milan Babuskov
inoffensive_2006 wrote:
> st->Prepare(sql_string.c_str());
> st->Execute();
> row_has_been_read = st->Fetch();
> while (row_has_been_read && !error_found)
> {
> {
> contact_record_ptr = new CONTACT_RECORD;
> contact_record_vector_ptr->
> push_back(contact_record_ptr);

You code seems quite straightforward except for this one here. Is
contact_record_vector_ptr a std::vector? Pushing back records one by one
is not very effective. You should try to reserve space in vector in
chunks of 1000 or more.

> When run as the first query this selects records
> at the rate of almost 350 rows / second. I then
> test a number of SELECT statements selecting
> different columns, including just the key and the
> sort name. The table is fairly large, and the
> SELECT key and sort name max out at around 425.
> But the second and third selects of these columns
> in this sample top out at an impressive
> 8000 rows / second.

Not too impressive. This (6k-9k records/second) is a regular speed I get
from exporting various data via FBExport (which uses IBPP).

Perhaps you should try to run the same select with FBExport yourself
(it's an open source tool, see my signature) and if you get any speed
difference. If it's still slow, perhaps your database has a lot of
garbage (old records) and backup+restore cycle would help.


Milan Babuskov