Subject RE: [firebird-support] Re: Please Advise
Author Svein Erling Tysvær
There are lots of pitfalls, Ahmad, and it is impossible to tell the cause without knowing what you are doing with your database.

The part that is most simple to say and fix, is that .GDB is the wrong filename extension for Windows XP. Upon making the first connection, XP makes a backup of the file before allowing you to update it (because it believes it to be a different type of file). Changing the filename to e.g. .FDB while no-one is connected fixes this.

The rest of what you should do is database related. Ask yourself two questions. The first is: 'Am I treating Firebird as a client/server database, a desktop database or something else?' Firebird has to be treated like a client/server database to perform well. That means that you should think in terms of sets, and not in terms of tables, always making as specific queries as possible, like

SELECT address, phonenumber FROM PERSON
WHERE firstname = 'Artur'
AND lastname = 'Anjos'
AND town = 'Lisboa'

and not general queries like

SELECT * FROM PERSON

The second question is: 'Am I taking proper care of my transactions?' Firebird uses a multi-generational architecture (MGA), meaning that a record can exist in several versions. Almost everything within Firebird happens within transactions, and depending on the transaction that asks for information was started and what type of isolation the transaction uses, which version you're allowed to see may vary. If you have one or more transaction that was started long ago, and lots of transactions have updated the database since that first transaction started, then Firebird has to keep track of lots of versions, meaning that things gradually slows down. It is easy to check whether this is a problem - when things are slow, run some statistics and look at the oldest transaction, oldest active transaction and next transaction. If there is a big gap, then you have a problem with your transaction handling. The growing database that you report, is a typical symptom of one or more long-running transactions, so it seems as if you are at least having this problem. Databases with well managed transactions would normally grow a bit after being restored, but then slow down or stop growing. Anyway, 34 Mb isn't much data, many of us work with databases containing gigabytes (millions of records in several tables) and we are still happy with the performance.

Of course there can be other reasons for Firebird being perceived as 'slow', like e.g. Firebird being chatty and using it across the internet requires a three-layer architecture or if you expect to be able to insert 100000 records per second, then Firebird simply cannot do so (I think).

HTH,
Set

>I already moved to a new Server IBM X3400 with 4GB RAM,, but still
>slow as before (No changes)
>before time I did backup and restore my GDB using IBExpert2.5 for
>firebird, it was getting faster and the file size decreasing to 1/4
>(140MB to about 34MB) , but after few days it starts slow down
>again, and size increasing,,,
>
>should I make (back-up & Restore) every day?
>anyway back-up & Restore is not very effective as much I need
>
>retrieving data i mean Running specific queries across network or
>any action in the application it self (local & on server)even users
>logining
>
>my application built on delphi with GDB firebird, every year it
>becomes slower than the prev. year, these days its boring (slow).
>
>I need to increase the speed of retreving data in my application, i am
>not developer but i know in general about firebird database and server.

>i am using firebird server 1.0 but it is soo slow (server action and
>local action), if i installed the new version of firebird engin is that
>will increase the speed.
>
>please tell me i need to do it quickly, and as i said i am not professional