I have simplified my native query so it references the fields directly, but still the query is not being optimised. I have tried this with the latest development version 6.3.201 and I have db4o-6.3-nqopt.jar and bloat-1.0.jar in the classpath. The revised query is shown below including the runtime diagnostic messages.
I have checked the reference documentation for Native Query Optimisation and it seems to suggest optimisation only works for primitive types and String. Could it be that Db4o cannot yet optimise queries which reference java.util.Date fields?
public static final class DailyAppointmentsQuery
extends Predicate<Appointment>
{
private Date date;
public DailyAppointmentsQuery(Date date)
{
this.date = (Date) date.clone();
}
public boolean match(Appointment appointment)
{
return appointment.appointmentDate.equals(date);
}
}
es.database.Appointment$DailyAppointmentsQuery@159ea8e :: Native Query Predicate could not be run optimized
This Native Query was run by instantiating all objects of the candidate class. Consider simplifying the expression in the Native Query method. If you feel that the Native Query processor should understand your code better, you are invited to post yout query code to db4o forums at http://developer.db4o.com/forums
:: db4o 6.3.201 Diagnostics ::
es.database.Appointment :: Query candidate set could not be loaded from a field index
Consider indexing fields that you query for: Db4o.configure().objectClass([class]).objectField([fieldName]).indexed(true)
:: db4o 6.3.201 Diagnostics ::
As an aside, it took my laptop over 2.5 hours to extract the 6.3 download file. Is this normal? My laptop has an AMD 64bit 1.8GHz processor with 1.25GB memory and is running Windows Vista Home Premium 32 bit. The 6.1 download also usually takes over an hour to extract. This seems to me to be a very long time just to extract a download file but I wondered what other users experiences are.
Regards
Graham