[Dbmail-dev] Firebird backend

2004-09-09 Thread Dominik Fässler
Hi all I'm new in this mailing list. My job was/is to setup a mailserver with postfix and a database backend. One of the condition is to use Firebird as DBMS, so i decided to write another backend for dbmail. If you not know Firebird, it's a open source database ported from Interbase, wich suppo

Re: [Dbmail-dev] Firebird backend

2004-09-09 Thread Aaron Stone
Dominik Fässler <[EMAIL PROTECTED]> said: > > The main problem is, that Firebird's API not supports db_num_rows(), > respectively only rows affected on INSERT, UPDATE and DELETE (not on > SELECT). For this reason i correct all files, which contains > db_num_rows() with db_fetch_row() statements. I

Re: [Dbmail-dev] Firebird backend

2004-09-09 Thread Dominik Faessler
Aaron Stone wrote: Is this in place of using a for loop? It would work, but there might be some code where memory allocations or other logic occurs on the basis of the number of rows that were found. Just keep an eye out for such things. I've seen the code fragments, where memory allocation oc

Re: [Dbmail-dev] Firebird backend

2004-09-10 Thread Aaron Stone
Dominik Faessler <[EMAIL PROTECTED]> said: > Aaron Stone wrote: > >>Is this in place of using a for loop? It would work, but there might be >>some code where memory allocations or other logic occurs on the basis of >>the number of rows that were found. Just keep an eye out for such things. >> > I

Re: [Dbmail-dev] Firebird backend

2004-09-10 Thread Dominik Fässler
I've read that 'select count(*)...' is faster only if you aren't then selecting all of the rows two lines later, in which case there's no benefit. Which is to say, there won't be any drawback to eliminating our use of num_rows() style functions, except gnarlier code in those places :-\ Ok, I w

Re: [Dbmail-dev] Firebird backend

2004-09-11 Thread Aaron Stone
Dominik Fässler <[EMAIL PROTECTED]> said: >>I've read that 'select count(*)...' is faster only if you aren't then >>selecting all of the rows two lines later, in which case there's no >>benefit. Which is to say, there won't be any drawback to eliminating our >>use of num_rows() style functions, ex

Re: [Dbmail-dev] Firebird backend

2004-09-11 Thread Dominik Faessler
*Aaron Stone wrote: likely that libdbi is adding this functionality. More likely, it's just faking it somehow by retrieving all of the rows, counting them, and caching them with the hope that they'll be requested later on anyways. A numrows() solution will be the quick way to a first version, b

Re: [Dbmail-dev] Firebird backend

2004-09-11 Thread Thomas Mueller
Hi, > >A numrows() solution will be the quick way to a first version, but we may > >discover that the performance is terrible and 'SELECT COUNT(*)' is needed. [..] > The advantage is, that we can initalize more resultsets, not have to > allocate memory and not have to query count(*) statements. P

Re: [Dbmail-dev] Firebird backend

2004-09-11 Thread Dominik Faessler
Hi The advantage is, that we can initalize more resultsets, not have to allocate memory and not have to query count(*) statements. Please never use 'SELECT COUNT(*)', the performance of Postgres' count(*) is horrible. 'explain analyze select count(*) from dbmail_messages' takes 600ms for my 6