摘要: 分表:到底是一对多还是多对1要看从那个角度出发分表后需要为表添加关联关系在老师表中的部门编号为1,但是1号部门根本不存在,所以该数据不是一条完整的数据需要通过外键约束,来保证数据只要插入就是完整的数据 create table dept(id int primary key auto_increment, name char(10), job char(30)); create table ... 阅读全文
posted @ 2019-03-15 17:09 777ijBGly- 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 引擎指的是一个系统的核心部分引擎有不同分类是为了适应不同的使用场景查看mysql支持的所有引擎show enginesMRG_MYISAM 是一堆MYISAM表的集合 用于做水平分表,如果一个表中数据量太大 将导致效率降低 水平分表就是把整个大表拆成不同的小表,每一次查询会先判断数据在哪一个表中 然 阅读全文
posted @ 2019-03-15 17:04 777ijBGly- 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 数据库 就是存储数据的仓库(容器)存储数据的方式1.变量 无法永久存储2.文件处理,可以永久存储文件处理存在的弊端: 1.文件处理速度慢 2.文件只能本机读写 无法被共享 单台计算机的性能终归是有限的两种方式1.升级硬件设备 提升幅度有限 垂直扩展2.服务器集群 分布式 横向扩展 可插拔设计(在一个 阅读全文
posted @ 2019-03-13 14:48 777ijBGly- 阅读(268) 评论(0) 推荐(0) 编辑
摘要: import socket,os c=socket.socket() c.connect(('127.0.0.1',1688)) while True: msg='%s 发来问候!'%os.getpid() if not msg:continue c.send(msg.encode()) data= 阅读全文
posted @ 2019-03-12 18:47 777ijBGly- 阅读(822) 评论(0) 推荐(0) 编辑
摘要: # from concurrent.futures import ProcessPoolExecutor # # # import time,random # # # def task(num): # time.sleep(random.randint(1,3)) # print(num**2) # 阅读全文
posted @ 2019-03-11 16:58 777ijBGly- 阅读(213) 评论(0) 推荐(0) 编辑
摘要: from multiprocessing import Process from threading import Thread,enumerate,current_thread import time def task(): with open("2.昨日回顾","rt",encoding="ut 阅读全文
posted @ 2019-03-08 16:08 777ijBGly- 阅读(169) 评论(0) 推荐(0) 编辑
摘要: # from multiprocessing import Process,Queue,JoinableQueue # import time,random # # # 生产者 # def make_hot_dog(q): # for i in range(1,6): # time.sleep(ra 阅读全文
posted @ 2019-03-07 15:32 777ijBGly- 阅读(245) 评论(0) 推荐(0) 编辑
摘要: # from multiprocessing import Process,Lock # import time,random # # def task1(lock): # lock.acquire() # print('惺惺相惜想') # time.sleep(random.randint(1,2 阅读全文
posted @ 2019-03-07 14:51 777ijBGly- 阅读(174) 评论(0) 推荐(0) 编辑
摘要: from multiprocessing import Process import os # a_apple='一个苹果' # def task(): # print('子进程的name',__name__) # print('子进程执行中..') # print('我是子进程 我的pid:%s 阅读全文
posted @ 2019-03-05 17:04 777ijBGly- 阅读(369) 评论(0) 推荐(0) 编辑
摘要: import socket c=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) addr=('127.0.0.1',8808) c.sendto('hello 我是udp客户端'.encode(),addr) print('over') data,ad 阅读全文
posted @ 2019-03-04 16:35 777ijBGly- 阅读(406) 评论(0) 推荐(0) 编辑