Subject | Re: [firebird-support] Re: how do i speed this up (Arno, are you there)? |
---|---|
Author | Arno Brinkman |
Post date | 2006-10-10T21:20Z |
Hi Set,
First i didn't read all messages back in this thread, but you've my attention ;-)
full query. However i'll give it a try:
SELECT
FIRST 20
SomeFields
FROM
TableX
WHERE
NotIndexField = :param
ORDER BY
FieldA, FieldID
Above query could only use an index for _ordering_ when "FieldA, FieldID" are in 1 index and also in
exactly the same order as direction (ASC/DESC). The PLAN should tell you this immediately. When
you're only fetching a few records with the FIRST/SKIP clause then an index is very helpfull for
retrieval.
Hope this helps somewhat else give some more information about what you want to achieve.
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info
First i didn't read all messages back in this thread, but you've my attention ;-)
> I don't understand how the optimizer works in cases like yours (SELECTI don't have enough information too tell what happen on this query, because i don't see a PLAN or a
> FIRST ... ORDER BY ... with a where clause that isn't selective at all).
full query. However i'll give it a try:
SELECT
FIRST 20
SomeFields
FROM
TableX
WHERE
NotIndexField = :param
ORDER BY
FieldA, FieldID
Above query could only use an index for _ordering_ when "FieldA, FieldID" are in 1 index and also in
exactly the same order as direction (ASC/DESC). The PLAN should tell you this immediately. When
you're only fetching a few records with the FIRST/SKIP clause then an index is very helpfull for
retrieval.
Hope this helps somewhat else give some more information about what you want to achieve.
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database development support:
http://www.databasedevelopmentforum.com
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Support list for Firebird and Interbase users :
firebird-support@yahoogroups.com
Nederlandse firebird nieuwsgroep :
news://newsgroups.firebirdsql.info