ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Mashenkov <andrey.mashen...@gmail.com>
Subject Re: Does equals method have relevance in Custom Key Class
Date Wed, 06 Jun 2018 09:37:31 GMT
Hi,

1. There are many ways to improve SQL query performance.
The basic rules are to use simple types (primitives, String, UUID and some
other JDK classes),
use inices with proper inline size to avoid unnecessary row lookups, use
right collocation.

2. This will not work. Ignite fully relies on internal binary object
comparison methods rather than 'equals()' method.
Get operation is key-value API operation that expects key is unique for
each entry.
So, get() always return a single value.

Why you think your way is workable? Have you tried to validate it with JDK
HashMap?

On Tue, Jun 5, 2018 at 8:37 AM, the_palakkaran <jikkuj@suntecsbs.com> wrote:

> The SQL queries are not getting me performance that I want. So I was trying
> for alternative methods to handle the same using get.
>
> Like getting the data using cache.get() and filtering them with the sql
> operations that I actually wanted to do.
>
> Suppose I have an equals method which will have two return cases working
> based on a field value "Y" or "N". So there are basically two cases in
> equals which will get executed based on the field value. That way I can get
> results differently, right?
>
> for example in a customer key class, I have a customer id and a customer
> number fields. In my equals method I have something like this:
>
> if("Y".equals(field))
>         return (null != this.custNo && null != custNo &&
> this.custNo.compareTo(CustomerMaster.custNo) == 0)
> else
>         return (null != this.custId && null != custId &&
> this.custId.compareTo(CustomerMaster.custId) == 0)
>
> This would fetch me records differently, right?
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>



-- 
Best regards,
Andrey V. Mashenkov

Mime
View raw message