| DotNetFirebird Using Firebird SQL in .NET. |
|
Home
Features
Download
Documentation
FAQ
Tools and Code
About
Blog
|
Tuesday, March 29, 2005
Multiple Firebird Server Instances
Recently I've been writing about detecting Firebird server installations. Well, the registry structure supports multiple instances but the Firebird tools not, so far. There are two utilities in the Firebird installation:
Tuesday, March 22, 2005
First Firebird 2.0 Alpha is Out
New features:
Thursday, March 17, 2005
Improving Query Performance through Index SelectivityThe Firebird query optimizer uses index "selectivity" or "statistics" for selecting the most effective query execution plan. Index selectivity is a number that describes how variable the indexed field values are, it is something like: 1/(DISTINCT COUNT(*)) That means the lower selectivity the better index. Values close to 1 (e.g. 0.5 for values like MALE/FEMALE) mean that the index is not effective and should be dropped. You can get the indices selectivity by calling: SELECT RDB$INDEX_NAME, RDB$STATISTICS FROM RDB$INDICES; Warning: In Firebird, the selectivity is calculated only in some cases:
That means: In case you create the index before there are any data in the table the selectivity value will be 1. For getting the best performance (i.e. giving the optimizer correct information) you should recalculate the selectivity after major data changes. You can do this using this command for a single index: SET STATISTICS INDEX index_name; It is also possible to recalculate all indices selectivity using this stored procedure: SET TERM ^ ; Execute this stored procedure by calling: EXECUTE PROCEDURE MAINTENANCE_SELECTIVITY; Wednesday, March 09, 2005
Fulltext Search for Firebird SQL (CodeProject Article)See my latest CodeProject article: Fulltext Search for Firebird SQL. Batch SQL/DDL ExecutionThe FirebirdSql.Data.Firebird.Isql namespace provides classes for batch SQL/DDL execution. This allows you to make such operations as:
Running a batch script is not difficult. First you need to parse the script using FbScript class: FbScript script = new FbScript("employee.sql"); The result is stored in script.Results, one item per command. Now we can use FbBatchExecution class to run the script: FbConnection c = new FbConnection(@"Database=employee.fdb;User=SYSDBA;Password=masterkey"); By default, the transaction is committed after each command. You can disable this by calling fbe.Execute(false). Here is a complete example that uses an embedded Firebird to create a new employee.fdb database and initialize the structure using a DDL script. The DDL script is generated from the example employee.fdb (it's modified on two places because of the current bugs in the provider, see the Known Issues below). On my Athlon XP 2000+ the execution of this batch script takes 0.921 seconds - which is very good I guess. Known Issues
Update The issues are already fixed because my changes were incorporated into the provider. Download
Related
Monday, March 07, 2005
Firebird Advantages over PostgreSQL
A lot of people are asking for Firebird versus PostgreSQL comparison. This is a difficult task - both databases have much in common. For the beginning, let's start with Firebird's advantages:
Saturday, March 05, 2005
Firebird 2.0 Alpha Coming SoonThe Firebird Project will soon be releasing the first public "alpha" release of Firebird 2.0. Version 2.0 is a long-awaited important major release of Firebird with many new features, enhancements and bugfixes (see alpha Release Notes for details). In number of changes, the jump in this release is equivalent if not greater than the transition from version 1.0 to version 1.5. Read more: Firebird 2.0 call for testers. Using FbConnectionStringBuilderFirebird ADO.NET provider supports a new class (FbConnectionStringBuilder) that makes the work with connection strings much easier: 1. Parsing a connection string Create a new instance using public FbConnectionStringBuilder(string) constructor (it takes an existing connection string as a parameter). Then you can read the connection string values by using the FbConnectionStringBuilder properties. Example of reading the DataSource (server address) property: FbConnectionStringBuilder csb = new
FbConnectionStringBuilder("User=SYSDBA;Password=masterkey;Database=SampleDatabase.fdb;DataSource=localhost;Charset=NONE;"); 2. Creating a connection string programmatically You can create a connection string by specifying the properties item by item: FbConnectionStringBuilder csb = new FbConnectionString(); 3. Modifying an existing connection string You can also modify an existing connection string without complicated parsing. This example switches the type of server to embedded Firebird: FbConnectionStringBuilder csb = new FbConnectionString(existingConnectionString); Wednesday, March 02, 2005
What's New in Firebird ADO.NET Provider 1.7
The ADO.NET provider 1.7 is currently in RC2. This is the list of main new features (compared to 1.6.3):
Previous
Archives
Copyright © 2005 - 2007 DotNetFirebird |