Subject Re: [firebird-support] Re: Performance
Author Aage Johansen
pokka_chi wrote:
> ...
> I have just tried a single update UPDATE ... WHERE A=1 AND B=2 AND C=3
> after restarting my machine. I expected this to be instant as there is
> only one record. It turned out to be around 5 minutes. When I did it
> again the second time, it was instant.

When you experience "query is slow the first time" _and_ "fast the
next time", you should check whether "garbage collection" happened in
the first run.
Did you already eliminate this scenario?

You also asked:
If I have a unique compound key of (A, B) and I want to locate a
particular record, I would normally use something like
SELECT * FROM mytable WHERE A = 1 AND B = 2.
Now if there are 1 million records satisfying A=1 and another million
records satisfying B=2, then will FB need to read 2 million records
before finding the intersaction?

If you have a compund index on (A,B) only records satisfying
"where A=1 and B=2" should be read.

Aage J.