cqengine result set iteration is slow , taking 0.7sec to iterate 15k records on an average

89 views
Skip to first unread message

Ramesh M

unread,
Apr 12, 2019, 11:29:27 PM4/12/19
to cqengine-discuss
Hi All,

cqengine result set iteration is slow, taking 0.7sec to iterate 20k records on an average, is there a way we reduce even further?, running this on high configuration machine.

adding 0.8 million records to cars object, query execution 2-5 is milliseconds, but the result set iteration is taking more time than I am expecting iterating same list using different place using java for each taking in 30-50milli seconds on average.

List<Car> dataTobeSaved = new ArrayList<Car>();
SQLParser<Car> parser = SQLParser.forPojoWithAttributes(Car.class, createAttributes(Car.class));
    IndexedCollection<Car> cars = new ConcurrentIndexedCollection<Car>();
    cars.addAll(CarFactory.createCollectionOfCars(10));

    ResultSet<Car> results = parser.retrieve(cars, "SELECT * FROM cars WHERE (" +
                                    "(manufacturer = 'Ford' OR manufacturer = 'Honda') " +
                                    "AND price <= 5000.0 " +
                                    "AND color NOT IN ('GREEN', 'WHITE')) " +
                                    "ORDER BY manufacturer DESC, price ASC");

//below loop taking time
for (Car car: results) {
dataTobeSaved.add(car);
}

//belwo loop taking less time than above - both cases size it same. Note: I can't do below logic in the above loop I'll cumulate 200 + engine filtered data and process below logic 
for (Car car: dataTobeSaved){
//additional buiness logic
}




Reply all
Reply to author
Forward
0 new messages