ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neerajbhatt <neerajbhatt2...@gmail.com>
Subject Group index taking too much time
Date Wed, 05 Jul 2017 12:17:54 GMT
Hi All

We have pushed around 1.4 million item objects (with group index) and with
following query takes around 80 ms (on server), which is way ahead for our
use case. Please suggest

String rating="0";
String review="0";
String download="0";

StringBuilder buff = new StringBuilder("SELECT T._VAL FROM "
				+ "ITEMCACHE.Item as T "
			 	+ " WHERE  "
				+ " T.rating=? AND T.reviews=? AND T.downloads=? "
				+ " limit 10");

SqlFieldsQuery qry = new SqlFieldsQuery(buff.toString());

List<List&lt;?>> res = cache.query(qry.setArgs(new
Object[]{rating,review,download})).getAll();

///Item object is

public class Item2 implements Serializable {

	private static final long serialVersionUID = 1L;

	@QuerySqlField(index = true, orderedGroups = { @QuerySqlField.Group(name =
"idx1", order = 2) })
	private int downloads;

	@QuerySqlField(index = true, orderedGroups = { @QuerySqlField.Group(name =
"idx1", order = 0) })
	private double rating;

	@QuerySqlField(index = true, orderedGroups = { @QuerySqlField.Group(name =
"idx1", order = 1) })
	private int reviews;
	@QuerySqlField(index = true)
	@AffinityKeyMapped
	private String id;
	public int getDownloads() {
		return downloads;
	}
	public void setDownloads(int downloads) {
		this.downloads = downloads;
	}
	public double getRating() {
		return rating;
	}
	public void setRating(double rating) {
		this.rating = rating;
	}
	public int getReviews() {
		return reviews;
	}
	public void setReviews(int reviews) {
		this.reviews = reviews;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public static long getSerialversionuid() {
		return serialVersionUID;
	}






--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Group-index-taking-too-much-time-tp14320.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message