📄 compress.result
字号:
SHOW STATUS LIKE 'Compression';Variable_name ValueCompression ONdrop table if exists t1,t2,t3,t4;CREATE TABLE t1 (Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL);INSERT INTO t1 VALUES (9410,9412);select period from t1;period9410select * from t1;Period Varor_period9410 9412select t1.* from t1;Period Varor_period9410 9412CREATE TABLE t2 (auto int not null auto_increment,fld1 int(6) unsigned zerofill DEFAULT '000000' NOT NULL,companynr tinyint(2) unsigned zerofill DEFAULT '00' NOT NULL,fld3 char(30) DEFAULT '' NOT NULL,fld4 char(35) DEFAULT '' NOT NULL,fld5 char(35) DEFAULT '' NOT NULL,fld6 char(4) DEFAULT '' NOT NULL,UNIQUE fld1 (fld1),KEY fld3 (fld3),PRIMARY KEY (auto));select t2.fld3 from t2 where companynr = 58 and fld3 like "%imaginable%";fld3imaginableselect fld3 from t2 where fld3 like "%cultivation" ;fld3cultivationselect t2.fld3,companynr from t2 where companynr = 57+1 order by fld3;fld3 companynrconcoct 58druggists 58engrossing 58Eurydice 58exclaimers 58ferociousness 58hopelessness 58Huey 58imaginable 58judges 58merging 58ostrich 58peering 58Phelps 58presumes 58Ruth 58sentences 58Shylock 58straggled 58synergy 58thanking 58tying 58unlocks 58select fld3,companynr from t2 where companynr = 58 order by fld3;fld3 companynrconcoct 58druggists 58engrossing 58Eurydice 58exclaimers 58ferociousness 58hopelessness 58Huey 58imaginable 58judges 58merging 58ostrich 58peering 58Phelps 58presumes 58Ruth 58sentences 58Shylock 58straggled 58synergy 58thanking 58tying 58unlocks 58select fld3 from t2 order by fld3 desc limit 10;fld3youthfulnessyelpedWotanworkersWittwitchcraftWinsettWillywilledwildcatsselect fld3 from t2 order by fld3 desc limit 5;fld3youthfulnessyelpedWotanworkersWittselect fld3 from t2 order by fld3 desc limit 5,5;fld3witchcraftWinsettWillywilledwildcatsselect t2.fld3 from t2 where fld3 = 'honeysuckle';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'honeysuckl_';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'hon_ysuckl_';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'honeysuckle%';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'h%le';fld3honeysuckleselect t2.fld3 from t2 where fld3 LIKE 'honeysuckle_';fld3select t2.fld3 from t2 where fld3 LIKE 'don_t_find_me_please%';fld3explain select t2.fld3 from t2 where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using indexexplain select fld3 from t2 ignore index (fld3) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select fld3 from t2 use index (fld1) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using whereexplain select fld3 from t2 use index (fld3) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using indexexplain select fld3 from t2 use index (fld1,fld3) where fld3 = 'honeysuckle';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref fld3 fld3 30 const 1 Using where; Using indexexplain select fld3 from t2 ignore index (fld3,not_used);ERROR 42000: Key column 'not_used' doesn't exist in tableexplain select fld3 from t2 use index (not_used);ERROR 42000: Key column 'not_used' doesn't exist in tableselect t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;fld3honeysucklehonoringexplain select t2.fld3 from t2 where fld3 >= 'honeysuckle' and fld3 <= 'honoring' order by fld3;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range fld3 fld3 30 NULL 2 Using where; Using indexselect fld1,fld3 from t2 where fld3="Colombo" or fld3 = "nondecreasing" order by fld3;fld1 fld3148504 Colombo068305 Colombo000000 nondecreasingselect fld1,fld3 from t2 where companynr = 37 and fld3 = 'appendixes';fld1 fld3232605 appendixes1232605 appendixes1232606 appendixes1232607 appendixes1232608 appendixes1232609 appendixesselect fld1 from t2 where fld1=250501 or fld1="250502";fld1250501250502explain select fld1 from t2 where fld1=250501 or fld1="250502";id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range fld1 fld1 4 NULL 2 Using where; Using indexselect fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;fld1250501250502250505250601explain select fld1 from t2 where fld1=250501 or fld1=250502 or fld1 >= 250505 and fld1 <= 250601 or fld1 between 250501 and 250502;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range fld1 fld1 4 NULL 4 Using where; Using indexselect fld1,fld3 from t2 where companynr = 37 and fld3 like 'f%';fld1 fld3218401 faithful018007 fanatic228311 fated018017 featherweight218022 feed088303 feminine058004 Fenton038017 fetched018054 fetters208101 fiftieth238007 filial013606 fingerings218008 finishers038205 firearm188505 fitting202301 Fitzpatrick238008 fixedly012001 flanking018103 flint018104 flopping188007 flurried013602 foldout226205 foothill232102 forgivably228306 forthcoming186002 freakish208113 freest231315 freezes036002 funereal226209 furnishings198006 furthermoreselect fld3 from t2 where fld3 like "L%" and fld3 = "ok";fld3select fld3 from t2 where (fld3 like "C%" and fld3 = "Chantilly");fld3Chantillyselect fld1,fld3 from t2 where fld1 like "25050%";fld1 fld3250501 poisoning250502 Iraqis250503 heaving250504 population250505 bombselect fld1,fld3 from t2 where fld1 like "25050_";fld1 fld3250501 poisoning250502 Iraqis250503 heaving250504 population250505 bombselect distinct companynr from t2;companynr003736505829405365413468select distinct companynr from t2 order by companynr;companynr002934363740415053586568select distinct companynr from t2 order by companynr desc;companynr686558535041403736342900select distinct t2.fld3,period from t2,t1 where companynr=37 and fld3 like "O%";fld3 periodobliterates 9410offload 9410opaquely 9410organizer 9410overestimating 9410overlay 9410select distinct fld3 from t2 where companynr = 34 order by fld3;fld3absenteeaccessedaheadalphabeticAsiaticizationsattitudeayebankruptciesbelaysBlythebombboulevardbulldozescannotcaressingcharcoalchecksummingchessclubroomcolorfulcosycreatorcryingDariusdiffusingdualityEiffelEpiphanyErnestineexplorersexterminatedfamineforkedGershwinsheavingHodgesIraqisItalianizationLagoslandslidelibrettoMajorcamasteringnarrowedoccurredofferersPalestinePeruvianizespharmaceuticpoisoningpopulationPygmalionratsrealestrecordingregimentedretransmittingreviverrousesscarssickersleepwalkstoppedsugarstranslatableunclesunexpecteduprisingsversatilityvestselect distinct fld3 from t2 limit 10;fld3abatesabidingAbrahamabrogatingabsenteeabutaccessedaccruingaccumulatingaccuraciesselect distinct fld3 from t2 having fld3 like "A%" limit 10;fld3abatesabidingAbrahamabrogatingabsenteeabutaccessedaccruingaccumulatingaccuraciesselect distinct substring(fld3,1,3) from t2 where fld3 like "A%";substring(fld3,1,3)abaabiAbrabsabuaccacqacuAdeadjAdladmAdoadsadvaeraffafiaflafoagiaheaimairAldalgaliallalpalramaameammanaandaneAnganiAnnAntapiappaquAraarcArmarrArtAsiaskaspassastattaudAugautaveavoaweayeAztselect distinct substring(fld3,1,3) as a from t2 having a like "A%" order by a limit 10;aabaabiAbrabsabuaccacqacuAdeadjselect distinct substring(fld3,1,3) from t2 where fld3 like "A%" limit 10;substring(fld3,1,3)abaabiAbrabsabuaccacqacuAdeadjselect distinct substring(fld3,1,3) as a from t2 having a like "A%" limit 10;aabaabiAbrabsabuaccacqacuAdeadjcreate table t3 (period int not null,name char(32) not null,companynr int not null,price double(11,0),price2 double(11,0),key (period),key (name));create temporary table tmp engine = myisam select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;insert into tmp select * from t3;insert into t3 select * from tmp;alter table t3 add t2nr int not null auto_increment primary key first;drop table tmp;SET SQL_BIG_TABLES=1;select distinct concat(fld3," ",fld3) as namn from t2,t3 where t2.fld1=t3.t2nr order by namn limit 10;namnAbraham Abrahamabrogating abrogatingadmonishing admonishingAdolph Adolphafield afieldaging agingammonium ammoniumanalyzable analyzableanimals animalsanimized animizedSET SQL_BIG_TABLES=0;select distinct concat(fld3," ",fld3) from t2,t3 where t2.fld1=t3.t2nr order by fld3 limit 10;concat(fld3," ",fld3)Abraham Abrahamabrogating abrogatingadmonishing admonishingAdolph Adolphafield afieldaging agingammonium ammoniumanalyzable analyzableanimals animalsanimized animizedselect distinct fld5 from t2 limit 10;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -