Subject Re: GDS_PREPARE Performance Problem on some Windows Machines
Author kp1780w7
--- In firebird-support@yahoogroups.com, "kp1780w7" <kp1780w7@...> wrote:
>
> Hi,
>
> I experiencing a performance problem on some windows machines that i tracked down to gds_prepare using Intel's vtune. On some machines a sample program runs in about 0.3 seconds but on other machines it takes 15 seconds whish is about 50 times slower. I can find any differneces between the machines. All machines are Windows7 Service pack 1 running FB 2.5.0.26074
>
> The sample code below replicates the problem on some machines. The sql that is being passed in to to create multiple database tables one at a time.
>
> bool MyFunc ( char *Sql )
> {
> bool Retval = false;
>
> ISC_STATUS_ARRAY status;
>
> isc_start_transaction(status, &m_htrans, 1, &m_hdb, 0, NULL);
>
> if ( ! isc_dsql_execute_immediate(status, &m_hdb, &m_htrans, 0, Sql, 1, NULL) )
> Retval = true;
>
> isc_commit_transaction( status, &m_htrans );
> m_htrans = NULL;
>
> return Retval;
> }
>
> Thanks
>

***Solution***
We found the the problem was related to the hard disk controller mode on the newer machines. The mode was set to AHCI where the problem was occurring and IDE on the machines that did not have the problem. We switched the machines back to using IDE and the problem disappeared. We simulated this problem out side of Firebird by opening a file with the FILE_FLAG_WRITE_THROUGH and writing to the file. The combination of the FILE_FLAG_WRITE_THROUGH and the AHCI mode was ther cause. The problem disappeared in the test program when the hard disk was set to IDE and likewise resolved database performance.