MyISAM

Dynamic MySQL partitioning based on UnixTime

微笑、不失礼 提交于 2019-12-21 17:00:11
问题 My DB design includes multiple MYISAM tables with measurements collected online, Each row record contains auto-incremented id, some data and an integer representing unixtime. I am designing an aging mechanism, and i am interested to use MySQL partitioning to partition each such table based on unixtime dynamically. Say that i am interested that each partition will represent single month of data, last partition should represent 2 months, if records arrive for the next not represented month, the

MySQL数据库基础与操作(2)

痞子三分冷 提交于 2019-12-21 13:39:31
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> MySQL的存储引擎:存储引擎有很多,这里只介绍MyISAM和InnoDB MyISAM和InnoDB的区别 MyISAM:不需要事物,空间小,以查询访问为主 InnoDB:多删除、更新操作,安全性高,事务处理及并发控制 查看当前默认存储引擎 SHOW AVRIABLES LIKE 'storage_engine%'; 设置表的搜索引擎 语法:CREATE TABLE 表名(#省略代码)ENGINE=存储引擎; 例:CREATE TABLE `myisam` (id INT(4))ENGINE=MyISAM; DML语句--插入单条数据记录 语法:INSERT INTO 表名 [(字段名列表)] VALUES (值列表); 例:INSERT INTO `student`(`loginPwd`,`studentName`,`gradeId`,`phone`,`bornDate`) VALUES('123','黄小平',1,'13956799999','1996-5-8'); 注意:字段名是可选的,如省略则依次插入所有字段 多个列表和多个值之间使用逗号分隔 值列表和字段名列表一一对应 如插入的是表中部分数据,字段名列表必填 DML语句--插入多条数据记录 语法:INSERT INTO 新表(字段名列表)VALUES

MySQL Full-Text search vs Like %%

ⅰ亾dé卋堺 提交于 2019-12-21 09:29:56
问题 What are key differences and what is a use case for both of them? Thanks! 回答1: Full-text search is the kind of search based on special sort of index (full-text, obviously). So you get the power of O(lgN) while searching using it. While like %% always causes table fullscan which can be terrible slow (when you have 100k and more rows). Personally I use Like %% when it is a small table (0-1000 rows) and I'm sure that it will never grow (and, important, when like %% fits the task requirements).

Can I use InnoDB and MyISAM tables in ONE database?

那年仲夏 提交于 2019-12-21 08:07:06
问题 Obviously both have their benefits. MyISAM is fast but may get currupted easily, InnoDB is slow but is more stable thanks to transactions and foreign keys. So it could be good to mix both engines in one database. If that's possible? 回答1: REMEMBER! It's OK to mix table types in the same database! In fact it's recommended and frequently required. However, it is important to note that if you are having performance issues when joining the two types, try converting one to the other and see if that

What is the InnoDB equivalent of MyISAM's key_buffer_size?

徘徊边缘 提交于 2019-12-21 05:23:06
问题 When using MyISAM the configuration setting key_buffer_size defines the size of the global buffer where MySQL caches frequently used blocks of index data. What is the corresponding setting for InnoDB? 回答1: innodb_buffer_pool_size is the setting that controls the size of the memory buffer that InnoDB uses to cache indexes and data. It's an important performance option. See the manual page for the full explanation. The MySQL Performance Blog also has an article about how to choose a proper size

Why use InnoDB over MySIAM [duplicate]

六眼飞鱼酱① 提交于 2019-12-21 04:40:18
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Should I always prefer MySQL InnoDB over MyISAM? Under what conditions should InnoDB be used over MyISAM ? I've seen some MySQL optimization tests where MyISAM proves to be faster. All of my tables are MyISAM, so why should I switch to InnoDB? 回答1: Pros & Cons of InnoDB & MyISAM - InnoDB recovers from a crash or other unexpected shutdown by replaying its logs. InnoDB can be run in a mode where it has lower

Difference in required time to insert InnoDB/MyISAM records

断了今生、忘了曾经 提交于 2019-12-21 03:53:32
问题 I'm inserting records into a MySQL table and try to understand the differences in time it takes between a MyISAM table and a InnoDB table. This is the code to create the table: CREATE TABLE SpectrumData ( ID INT(11) NULL DEFAULT NULL, `Set` INT(11) NULL DEFAULT NULL, Wavelength DOUBLE NULL DEFAULT NULL, Intensity DOUBLE NULL DEFAULT NULL, Error INT(11) NULL DEFAULT NULL, `Status` INT(11) NULL DEFAULT NULL ) COLLATE='utf8_general_ci' ENGINE=xxx ROW_FORMAT=DEFAULT I insert 10000 records,

mysql面试题狂刷(四)

丶灬走出姿态 提交于 2019-12-20 18:21:43
1.数据库完整性约束 实体完整性、参照完整性、用户自定义完整性 2.存储过程、触发器、函数的区别 触发器与存储过程非常相似,触发器也是SQL语句集,两者唯一的区别是触发器不能用EXECUTE语句调用,而是在用户执行Transact-SQL语句时自动触发(激活)执行。触发器是在一个修改了指定表中的数据时执行的存储过程。通常通过创建触发器来强制实现不同表中的逻辑相关数据的引用完整性和一致性。由于用户不能绕过触发器,所以可以用它来强制实施复杂的业务规则,以确保数据的完整性。触发器不同于存储过程,触发器主要是通过事件执行触发而被执行的,而存储过程可以通过存储过程名称名字而直接调用。当对某一表进行诸如UPDATE、INSERT、DELETE这些操作时,SQLSERVER就会自动执行触发器所定义的SQL语句,从而确保对数据的处理必须符合这些SQL语句所定义的规则。 本质上没区别。只是函数有如:只能返回一个变量的限制。而存储过程可以返回多个。而函数是可以嵌入在sql中使用的,可以在select中调用,而存储过程不行。执行的本质都一样。函数限制比较多,比如不能用临时表,只能用表变量.还有一些函数都不可用等等.而存储过程的限制相对就比较少 1)一般来说,存储过程实现的功能要复杂一点,而函数的实现的功能针对性比较强。 2)对于存储过程来说可以返回参数,而函数只能返回值或者表对象。 3

MySQL:MySQL和SQL Server的区别

試著忘記壹切 提交于 2019-12-20 11:31:53
一、SQL Server基本简介 1.1,概述 SQL Server 是Microsoft 公司推出的关系型数据库管理系统。具有使用方便可伸缩性好与相关软件集成程度高等优点,可跨越从运行Microsoft Windows 98 的膝上型电脑到运行Microsoft Windows 2012 的大型多处理器的服务器等多种平台使用。 Microsoft SQL Server 是一个全面的数据库平台,使用集成的商业智能 (BI)工具提供了企业级的数据管理。Microsoft SQL Server 数据库引擎为关系型数据和结构化数据提供了更安全可靠的存储功能,使您可以构建和管理用于业务的高可用和高性能的数据应用程序。 1.2,应用范围 SQL Server的应用范围,和其具体的版本有一定的关系,基本上是:企业版(Enterprise Edition) (大中型企业商用);标准版(Standard Edition) (小型企业商用);开发版(Developer Edition) (开发公司、开发人员使用);个人版(Personal Edition) (开发人员使用);MSDE 2000(Microsoft SQL Server 2000 Desktop Engine)(简单的单机数据库、开发人员开发测试使用) 1.3,优缺点 (1) 扩展性强:当系统要更高数据库处理速度时

Speeding up conversion from MyISAM to InnoDB

ぃ、小莉子 提交于 2019-12-20 10:32:24
问题 I have a MySQL 1.5 GB MyISAM-table (1.0 GB data, 0.5 GB indexes) in production which I'm about to convert into InnoDB. Since the table is used in production I'd like to make the downtime as short as possible. My questions: What MySQL configuration options should be adjusted in order to speed up ALTER TABLE table_name ENGINE=InnoDB; ? What other tricks can be used in order to speed up conversion of a production database table from MyISAM to InnoDB? 回答1: Setting a large innodb_buffer_pool_size