facebook twitter youtube
Replication Query Optimization DB Tuning Server Load and Query Locking Linux Download Interview Questions Basic DB Commands Mysql
Mysql
in Mysql - 19 Feb, 2014
by Zafar Malik - no comments

Below are some facts related with B-TREE index usage by mysql and one example to understand this logic. a) If any table has approx. 75% same data then index will not be used instead mysql will do table scan. b) Normally mysql use only single index per table. c) Index ordering methodology: Mysql will use […]

in Mysql - 19 Feb, 2014
by Zafar Malik - no comments

Option1: If you want to keep ‘table’ in ‘Database’: Create below ‘stored procedure’: ———————————— DELIMITER $$ USE `test`$$ DROP PROCEDURE IF EXISTS `sp_variable_table`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_variable_table`() BEGIN SELECT CONCAT(‘zafar_’,REPLACE(TIME(NOW()),’:’,’_’)) INTO @tbl; SET @str=CONCAT(“create table “,@tbl,” (pbirfnum BIGINT(20) NOT NULL DEFAULT ’0′, paymentModes TEXT ,paymentmodeDetails TEXT ,shippingCharges TEXT ,shippingDetails TEXT ,hypenedSkuCodes TEXT ,skuCodes TEXT ,itemDetails […]

in Mysql - 13 Feb, 2014
by Zafar Malik - no comments

Suppose there is a title varchar(250) column and there is an index on it as per below Alter table mytable add index (title(16)); Case 1: select id, title from mytable where title=”This is my Title”; Here query will use index as searching string contains 16 character and our index also take care 16 characters.   […]

in Mysql - 13 Feb, 2014
by Zafar Malik - no comments

In simple wording, latin supports only latin characters (like english) but utf8 supports some special characters used in other international languages like french, chineese, arabic etc. As per standard, latin1 stores 1 character in 1 byte while utf8 1 character in 1-3 bytes. But if we store all characters in latin even in a utf8 […]