Subject Re: Performance of Firebird vs. other DBMS
Author johnson_dave2003
--- In firebird-support@yahoogroups.com, "laurenz_brein"
>
> SELECT COUNT(*) FROM PARENT WHERE NUMMER < ?
> SELECT COUNT(*) FROM CHILD WHERE NUMMER < ?
> INSERT INTO PARENT (ID, NAME, NUMMER) VALUES (?, ?, ?)
> INSERT INTO CHILD (ID, PARENT_ID, NAME, NUMMER) VALUES (?, ?, ?, ?)
> DELETE FROM PARENT WHERE ID = ?
> DELETE FROM CHILD WHERE ID = ?
> SELECT NAME, NUMMER FROM PARENT WHERE ID = ?
> SELECT PARENT_ID, NAME, NUMMER FROM CHILD WHERE ID = ?
> UPDATE PARENT SET NAME = ?, NUMMER = ? WHERE ID = ?
> UPDATE CHILD SET PARENT_ID = ?, NAME = ?, NUMMER = ? WHERE ID = ?
> SELECT COUNT(*) FROM PARENT WHERE ID > ?
> SELECT COUNT(*) FROM CHILD WHERE PARENT_ID > ?

select count (*) must hit every row in the table in a generational
architecture, because it needs to know whether or not the row is
visible to the transaction. Select count(*) is not a simple select
to this architecture.

A descending index on parentID may help.

>
> Do you think that the difference you mention can account for
> a factor of 4 for 'simple selects' compared to the worst competitor
> and a factor of 6 for 'table scans'?

yes ...
I'll review this in more detail later.