ReStore query question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ReStore query question

Bruno Brasesco
John,

When ReStore executes a query it use the DB indexes ?

For example:

aReStore instancesOf: Document satisfying:[:each | each creationDate <=
aDate].

If my DB has an index on date field, does ReStore use it in queries like
above ?


Regards
Bruno


Reply | Threaded
Open this post in threaded view
|

Re: ReStore query question

Esteban A. Maringolo-3
Bruno escribió:
> John,

> When ReStore executes a query it use the DB indexes ?

> For example:
> aReStore instancesOf: Document satisfying:[:each | each creationDate <=
> aDate].
> If my DB has an index on date field, does ReStore use it in queries like
> above ?

As far as I know, the index utilization is part of the RDBMS engine
query optimization.
You can turn on index statistics on your engine to know if the
indexes are beign used.
In MS SQL Server and Oracle 9 you can do it. AFAIR PostgreSQL is
also capable of that.

Regards,

--
Esteban.


Reply | Threaded
Open this post in threaded view
|

Re: ReStore query question

Sean M-3
In reply to this post by Bruno Brasesco
> When ReStore executes a query it use the DB indexes ?

When you query a database you don't need to have any knowledge of which
fields have indexes on them. The database will use an index if available,
and if not, will do a table scan(?)

So if you are using predicates on fields without indexes, and the table has
many rows, you'd probably benefit from placing an index on the field, but
this is done through the RDBMS management tool, not through any client tool
(Although I guess you could execute the required sql to create an index via
a client)

So in answer to your question: If an index has been defined, ReStore will
use it, just as a query via an access link table will use it