Subject | Re: [firebird-support] Why SELECT...IN ( ... ROWS 1000 ) so slowly! |
---|---|
Author | Arno Brinkman |
Post date | 2007-06-14T07:31:45Z |
Hi,
SELECT * FROM
(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) dt
JOIN Table2 t2 ON (t2.ID1 = dt.ID1)
ORDER BY
t2.ID2
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird strong open source database (based on IB-OE) with many SQL features:
http://www.firebirdsql.org
http://www.firebirdsql.info
General database developer support:
http://www.databasedevelopmentforum.com
Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info
> I use Firebird 2.0.1 in windows, and have a SQL query:Using a derived table:
>
> ....
>
> 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 ?
SELECT * FROM
(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) dt
JOIN Table2 t2 ON (t2.ID1 = dt.ID1)
ORDER BY
t2.ID2
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird strong open source database (based on IB-OE) with many SQL features:
http://www.firebirdsql.org
http://www.firebirdsql.info
General database developer support:
http://www.databasedevelopmentforum.com
Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info