Subject Why SELECT...IN ( ... ROWS 1000 ) so slowly!
Author liskman
Hi,

I use Firebird 2.0.1 in windows, and have a SQL query:

SELECT * FROM table2
WHERE id1 IN
( SELECT id1
FROM talbe1
WHERE recordtime BETWEEN '2007-06-13 00:00:00' AND '2007-06-13
23:59:59'
ORDER BY id1
ROWS 1000
)
ORDER BY id2;

if there is no "ROWS 1000", the query execute very fast(less than
200 ms), but add "ROWS 1000" to query, execute time is more than 20
sec. table1 have 3000 rows, table2 have 4000 rows.

Is there a way to optimize this query ?