FirebirdSQL / NETProvider

Firebird ADO.NET Data Provider
https://www.firebirdsql.org/en/net-provider/
Other
159 stars 65 forks source link

DataAdapter.Update method is very slow when database is located on flash disks [DNET320] #331

Open firebird-automations opened 14 years ago

firebird-automations commented 14 years ago

Submitted by: Yiannis Bourkelis (yiannis)

Attachments: SlowFirebirdInsert.zip script.sql

When the attached firebird database is located on a flash drive, the DataAdapter.Update method runs very slow when updating or adding new records. This is not happening on SANDISK CRUZER flash disk, but it is still slow.

I tested it with 2 flash drives, the APACER AH521 and the KINGSTON DT410 and it took around 30 seconds to insert 10 new records.

In the attached project modify the strConnectionString to point to a database located in a flash disk. The database.fdb file is located inside the SlowFirebirdInsert folder.

Using exactly the same code and database schema, but the VISTADB database engine, inserting 10 records took around 2 seconds on the above flash disks.

firebird-automations commented 14 years ago
Modified by: Yiannis Bourkelis (yiannis) Attachment: SlowFirebirdInsert\.zip \[ 11632 \]
firebird-automations commented 14 years ago

Commented by: @cincuranet

Is it slow when you're using i.e. isql?

firebird-automations commented 14 years ago

Commented by: Yiannis Bourkelis (yiannis)

Is there any way to see how much time does it take for an INSERT sql statement to execute using ISQL;

I tried to execute an INSERT statement, like the one the dataadapter uses to update the dataset and it looks that it executes fast.

I also tried to do 10 repeated INSERTS (using the keyboard on ISQL - up arrow > enter) and it took me around 5 seconds.

For the same queries using Dataadapter.Update it takes around 30 seconds.

firebird-automations commented 14 years ago

Commented by: @cincuranet

Run it like a script.

firebird-automations commented 14 years ago

Commented by: Yiannis Bourkelis (yiannis)

Ok, I ran it as a script and it executes very fast.

The attached script.sql contains 215 INSERT statements and completes in less than 500ms when the database resides on a flash disk.

This is what I did: 1.Execute isql.exe 2. connected to database and ran "CON> input "E:\script.sql"

firebird-automations commented 14 years ago

Commented by: Yiannis Bourkelis (yiannis)

This script contains 215 insert statements for the attached database.

firebird-automations commented 14 years ago
Modified by: Yiannis Bourkelis (yiannis) Attachment: script\.sql \[ 11640 \]
firebird-automations commented 14 years ago

Commented by: Yiannis Bourkelis (yiannis)

Jiri, where you able to reproduce this issue?