小编piy*_*kaj的帖子

BigQuery表上的索引

我有一个用例,其中我们在BigQuery中有几个表.现在我想在BigQuery表中的一个列上实现索引.但我没有找到足够的文件来做到这一点.我发现一些博客和帖子提到BigQuery不支持索引.请帮我找一个可以帮助我实现BigQuery索引的博客或帖子.提前致谢.

cloud google-bigquery

8
推荐指数
1
解决办法
1万
查看次数

如何使主键不是唯一的MySQL

我知道主键应该是唯一的.但我正在为地产代理商创建一个数据库,其中邮政编码是地址表的主键.但是,如果一个房产是出售/出租,并且它在一个公寓楼,许多房产将有相同的邮政编码.如何在保持PostCode作为PK的同时使其成为Uniqe?感谢你

我的代码到目前为止:

CREATE TABLE `Properties` (
  `PropertyID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `Property Type` varchar(20) NOT NULL,
  `PostCode` varchar(8) NOT NULL,
  `Bedrooms` tinyint(2) DEFAULT NULL,
  `Bathrooms` tinyint(2) DEFAULT NULL,
  `Ensuite` tinyint(1) DEFAULT NULL,
  `Kitchen` tinytext,
  `LivingRoom` tinytext,
  `DiningRoom` tinytext,
  `UtilityRoom` tinytext,
  `Conservatory` tinytext,
  `Garage` tinytext,
  `Garden` tinytext,
  `Furnished` tinytext,
  `Type` char(15) NOT NULL,
  PRIMARY KEY (`PropertyID`),
  KEY `Property Type` (`Property Type`),
  KEY `PostCode` (`PostCode`),
  CONSTRAINT `Properties_ibfk_2` FOREIGN KEY (`PostCode`) REFERENCES `Address` (`PostCode`),
  CONSTRAINT `Properties_ibfk_1` FOREIGN KEY (`Property Type`) REFERENCES `PropertyType` …
Run Code Online (Sandbox Code Playgroud)

mysql

1
推荐指数
2
解决办法
2万
查看次数

标签 统计

cloud ×1

google-bigquery ×1

mysql ×1