ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iceguo <gu...@ffcs.cn>
Subject Re: The result of cross-cache SQL joins is incomplete.
Date Sat, 07 Nov 2015 14:22:13 GMT
Thank you for your reply, but I am still not very clear about the rules of
setting a table for Replicated cache mode or Partition cache mode.
I have another a little more complicated example, could you help to analysis
it?

In this example, I have 6 tables 

/*Table structure for table `day_report` */
CREATE TABLE `day_report` (
  `report_date` date DEFAULT NULL,
  `money` decimal(10,0) DEFAULT NULL,
  `people` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `good` */

CREATE TABLE `good` (
  `id` int(11) NOT NULL,
  `name` varchar(200) DEFAULT NULL,
  `type` int(11) DEFAULT NULL,
  `money` decimal(10,0) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `good_type` */

CREATE TABLE `good_type` (
  `id` int(11) NOT NULL,
  `name` varchar(200) DEFAULT NULL,
  `pid` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `order_good` */

CREATE TABLE `order_good` (
  `order_id` int(11) DEFAULT NULL,
  `good_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `user` */

CREATE TABLE `user` (
  `id` int(11) NOT NULL,
  `name` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Table structure for table `user_order` */

CREATE TABLE `user_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `usr_id` int(11) DEFAULT NULL,
  `create_time` date DEFAULT NULL,
  `money` decimal(10,0) DEFAULT NULL,
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=500000 DEFAULT CHARSET=utf8;

The join connections of them as following:
day_report.report_date = user_order.create_time
user_order.type 	= good_type.pid
user_order.id = order_good.order_id
good.id = order_good.good_id

My questions are:
1. Some tables do not have primary key, should I need to add primary key on
them first before importing them to Ignite?
2. Which tables should be setting as Replicated cache mode? And which table
should be setting as partition cache mode?
3. Should I need to set any AffinityKey?
4. Some join connections are not connected to primary key(such as
day_report.report_date = user_order.create_time where create_time is not a
primary key), Does it have any affect?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/The-result-of-cross-cache-SQL-joins-is-incomplete-tp1723p1880.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message