You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Prasad Bhalerao <pr...@gmail.com> on 2018/02/15 14:35:17 UTC

Table creation in Ignite

Hi,

 As per this https://apacheignite-sql.readme.io/docs/create-table link,

The CREATE TABLE creates a new Ignite cache and defines an SQL table on top
of it. The cache stores the data in the form of key-value pairs while the
table allows processing the data with SQL queries.

Does it mean that it stores the data in table as well as in key value
cache? I meant to say that does it duplicates the data?

In which format does it store the table rows or column values?

When I fire a sql on table using jdbc approach, does it require to
de-serialize the data while doing index scan?

If I do not map the table to Java pojo, does this store the key and value
in Binary Object format in respective cache?

When I fire a sql (using SqlFieldsQuery) directly on a cache which sits on
top of this table, does it require de-serialization of value?

Can you please help me to understand this?


Thanks,
Prasad

Re: Table creation in Ignite

Posted by vkulichenko <va...@gmail.com>.
Prasad,

SQL engine never deserializes your objects and always works with binary
data, it does not depend on how you created and configured your schema.

As for "does querying table using jdbc code work faster than querying cache"
question, can you clarify it please? What exactly are you comparing?

-Val



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Table creation in Ignite

Posted by Prasad Bhalerao <pr...@gmail.com>.
Hello Mikhail,

Thank you for the clarification.
But still little confusion. Please correct me if I am wrong.

Simple scenario, I create a table in ignite and then map it to some Java
pojo. Now if I query the cache using SQL, ignite will just deserialize the
part pojo which is mentioned in where clause of SQL to filter/select the
data.
This behavior will remain same even if query the table instead of cache
using the jdbc code (simple prepared statement and execute query code).

Scenario 2:
If I don't map this table to any Java pojo and if I query the cache or
table using SQL having where clause, ignite will not deserialize anything
as the data (both key and value) is in binary fromat.

Scenario3:

 I populate the cache with the data fetched from oracle table using
CacheStore.loadCache method. The key value pair is stored in cache using
BinaryObject. Now if query the cache using SQL having where clause, ignite
will not deserialize the data(values in cache)  as the data is already in
binary format.

Can you please confirm if my understanding is correct?

Also, does querying table using jdbc code work faster than querying cache?

Regards,
Prasad


On Feb 15, 2018 9:38 PM, "Mikhail" <mi...@gmail.com> wrote:

Hi  Prasad,

>Does it mean that it stores the data in table as well as in key value
cache? I meant to say that does it duplicates the data?

There's no data duplication, everything is stored in ignite cache only. SQL
is just another way access to data. Plus SQL provides indices.

>In which format does it store the table rows or column values?

it stores everything as key/values pairs.

>When I fire a sql on table using jdbc approach, does it require to
de-serialize the data while doing index scan?

no, it doesn't de-serialize data, ignite stores everything as bytes and can
compare those data as bytes too without de-serialization to the original
type.

>If I do not map the table to Java pojo, does this store the key and value
in Binary Object format in respective cache?

right, anyway, it will store everything in cache, you don't need java
objects for this, ignite will use, as you said, binary objects.

>When I fire a sql (using SqlFieldsQuery) directly on a cache which sits on
top of this table, does it require de-serialization of value?

Ignite only will de-serialize only part of data that you specified in SELECT
statement that needs to be returned to you.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Table creation in Ignite

Posted by Mikhail <mi...@gmail.com>.
Hi  Prasad,

>Does it mean that it stores the data in table as well as in key value
cache? I meant to say that does it duplicates the data? 

There's no data duplication, everything is stored in ignite cache only. SQL
is just another way access to data. Plus SQL provides indices.

>In which format does it store the table rows or column values?

it stores everything as key/values pairs.

>When I fire a sql on table using jdbc approach, does it require to
de-serialize the data while doing index scan?

no, it doesn't de-serialize data, ignite stores everything as bytes and can
compare those data as bytes too without de-serialization to the original
type.

>If I do not map the table to Java pojo, does this store the key and value
in Binary Object format in respective cache?

right, anyway, it will store everything in cache, you don't need java
objects for this, ignite will use, as you said, binary objects.

>When I fire a sql (using SqlFieldsQuery) directly on a cache which sits on
top of this table, does it require de-serialization of value?

Ignite only will de-serialize only part of data that you specified in SELECT
statement that needs to be returned to you.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Table creation in Ignite

Posted by Prasad Bhalerao <pr...@gmail.com>.
Hi,

 As per this https://apacheignite-sql.readme.io/docs/create-table link,

The CREATE TABLE creates a new Ignite cache and defines an SQL table on top
of it. The cache stores the data in the form of key-value pairs while the
table allows processing the data with SQL queries.

Does it mean that it stores the data in table as well as in key value
cache? I meant to say that does it duplicates the data?

In which format does it store the table rows or column values?

When I fire a sql on table using jdbc approach, does it require to
de-serialize the data while doing index scan?

If I do not map the table to Java pojo, does this store the key and value
in Binary Object format in respective cache?

When I fire a sql (using SqlFieldsQuery) directly on a cache which sits on
top of this table, does it require de-serialization of value?


    Does querying on table works faster          than querying on cache?




Can you please help me to understand this?


Thanks,
Prasad