关闭

关闭

关闭

封号提示

内容

首页 高性能MySQL英文原版1.pdf

高性能MySQL英文原版1.pdf

高性能MySQL英文原版1.pdf

上传者: yele 2011-05-18 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《高性能MySQL英文原版1pdf》,可适用于IT/计算机领域,主题内容包含http:downzzbaikecomebook。http:downzzbaikecomebook。HighPerformanceMySQLhttp符等。

http:downzzbaikecomebook。http:downzzbaikecomebook。HighPerformanceMySQLhttp:downzzbaikecomebook。OtherMicrosoftNETresourcesfromO’ReillyRelatedtitlesManagingandUsingMySQLMySQLCookbookMySQLPocketReferenceMySQLReferenceManualLearningPHPPHPEssentialsPHPCookbookPracticalPostgreSQLProgrammingPHPSQLTuningWebDatabaseApplicationswithPHPandMySQLNETBooksResourceCenterdotnetoreillycomisacompletecatalogofO’Reilly’sbooksonNETandrelatedtechnologies,includingsamplechaptersandcodeexamplesONDotnetcomprovidesindependentcoverageoffundamental,interoperable,andemergingMicrosoftNETprogrammingandwebservicestechnologiesConferencesO’ReillyMediabringdiverseinnovatorstogethertonurturetheideasthatsparkrevolutionaryindustriesWespecializeindocumentingthelatesttoolsandsystems,translatingtheinnovator’sknowledgeintousefulskillsforthoseinthetrenchesVisitconferencesoreillycomforourupcomingeventsSafariBookshelf(safarioreillycom)isthepremieronlinereferencelibraryforprogrammersandITprofessionalsConductsearchesacrossmorethan,booksSubscriberscanzeroinonanswerstotimecriticalquestionsinamatterofsecondsReadthebooksonyourBookshelffromcovertocoverorsimplyfliptothepageyouneedTryittodayforfreehttp:downzzbaikecomebook。HighPerformanceMySQLSECONDEDITIONBaronSchwartz,PeterZaitsev,VadimTkachenko,JeremyDZawodny,ArjenLentz,andDerekJBallingBeijing•Cambridge•Farnham•Köln•Sebastopol•Taipei•Tokyohttp:downzzbaikecomebook。HighPerformanceMySQL,SecondEditionbyBaronSchwartz,PeterZaitsev,VadimTkachenko,JeremyDZawodny,ArjenLentz,andDerekJBallingCopyrightO’ReillyMedia,IncAllrightsreservedPrintedintheUnitedStatesofAmericaPublishedbyO’ReillyMedia,Inc,GravensteinHighwayNorth,Sebastopol,CAO’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluseOnlineeditionsarealsoavailableformosttitles(safarioreillycom)Formoreinformation,contactourcorporateinstitutionalsalesdepartment:()orcorporateoreillycomEditor:AndyOramProductionEditor:LoranahDimantCopyeditor:RachelWheelerProofreader:LoranahDimantIndexer:AngelaHowardCoverDesigner:KarenMontgomeryInteriorDesigner:DavidFutatoIllustrators:JessamynReadPrintingHistory:April:FirstEditionJune:SecondEditionNutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,IncHighPerformanceMySQL,theimageofasparrowhawk,andrelatedtradedressaretrademarksofO’ReillyMedia,IncManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthisbook,andO’ReillyMedia,Incwasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcapsWhileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedhereinThisbookusesRepKover,adurableandflexiblelayflatbindingISBN:Mhttp:downzzbaikecomebook。vTableofContentsForewordixPrefacexiMySQLArchitectureMySQL’sLogicalArchitectureConcurrencyControlTransactionsMultiversionConcurrencyControlMySQL’sStorageEnginesFindingBottlenecks:BenchmarkingandProfilingWhyBenchmarkBenchmarkingStrategiesBenchmarkingTacticsBenchmarkingToolsBenchmarkingExamplesProfilingOperatingSystemProfilingSchemaOptimizationandIndexingChoosingOptimalDataTypesIndexingBasicsIndexingStrategiesforHighPerformanceAnIndexingCaseStudyIndexandTableMaintenanceNormalizationandDenormalizationSpeedingUpALTERTABLENotesonStorageEngineshttp:downzzbaikecomebook。vi|TableofContentsQueryPerformanceOptimizationSlowQueryBasics:OptimizeDataAccessWaystoRestructureQueriesQueryExecutionBasicsLimitationsoftheMySQLQueryOptimizerOptimizingSpecificTypesofQueriesQueryOptimizerHintsUserDefinedVariablesAdvancedMySQLFeaturesTheMySQLQueryCacheStoringCodeInsideMySQLCursorsPreparedStatementsUserDefinedFunctionsViewsCharacterSetsandCollationsFullTextSearchingForeignKeyConstraintsMergeTablesandPartitioningDistributed(XA)TransactionsOptimizingServerSettingsConfigurationBasicsGeneralTuningTuningMySQL’sIOBehaviorTuningMySQLConcurrencyWorkloadBasedTuningTuningPerConnectionSettingsOperatingSystemandHardwareOptimizationWhatLimitsMySQL’sPerformanceHowtoSelectCPUsforMySQLBalancingMemoryandDiskResourcesChoosingHardwareforaSlaveRAIDPerformanceOptimizationStorageAreaNetworksandNetworkAttachedStorageUsingMultipleDiskVolumesNetworkConfigurationhttp:downzzbaikecomebook。TableofContents|viiChoosinganOperatingSystemChoosingaFilesystemThreadingSwappingOperatingSystemStatusReplicationReplicationOverviewSettingUpReplicationReplicationUndertheHoodReplicationTopologiesReplicationandCapacityPlanningReplicationAdministrationandMaintenanceReplicationProblemsandSolutionsHowFastIsReplicationTheFutureofMySQLReplicationScalingandHighAvailabilityTerminologyScalingMySQLLoadBalancingHighAvailabilityApplicationLevelOptimizationApplicationPerformanceOverviewWebServerIssuesCachingExtendingMySQLAlternativestoMySQLBackupandRecoveryOverviewConsiderationsandTradeoffsManagingandBackingUpBinaryLogsBackingUpDataRecoveringfromaBackupBackupandRecoverySpeedBackupToolsScriptingBackupshttp:downzzbaikecomebook。viii|TableofContentsSecurityTerminologyAccountBasicsOperatingSystemSecurityNetworkSecurityDataEncryptionMySQLinachrootedEnvironmentMySQLServerStatusSystemVariablesSHOWSTATUSSHOWINNODBSTATUSSHOWPROCESSLISTSHOWMUTEXSTATUSReplicationStatusINFORMATIONSCHEMAToolsforHighPerformanceInterfaceToolsMonitoringToolsAnalysisToolsMySQLUtilitiesSourcesofFurtherInformationATransferringLargeFilesBUsingEXPLAINCUsingSphinxwithMySQLDDebuggingLocksIndexhttp:downzzbaikecomebook。ixForewordIhaveknownPeter,Vadim,andArjenalongtimeandhavewitnessedtheirlonghistoryofbothusingMySQLfortheirownprojectsandtuningitforalotofdifferenthighprofilecustomersOnhisside,BaronhaswrittenclientsoftwarethatenhancestheusabilityofMySQLTheauthors’backgroundsareclearlyreflectedintheircompletereworkinginthissecondeditionofHighPerformanceMySQL:Optimizations,Replication,Backups,andMoreIt’snotjustabookthattellsyouhowtooptimizeyourworktouseMySQLbetterthaneverbeforeTheauthorshavedoneconsiderableextrawork,carryingoutandpublishingbenchmarkresultstoprovetheirpointsThiswillgiveyou,thereader,alotofvaluableinsightintoMySQL’sinnerworkingsthatyoucan’teasilyfindinanyotherbookInturn,thatwillallowyoutoavoidalotofmistakesinthefuturethatcanleadtosuboptimalperformanceIrecommendthisbookbothtonewusersofMySQLwhohaveplayedwiththeserveralittleandnowarereadytowritetheirfirstrealapplications,andtoexperienceduserswhoalreadyhavewelltunedMySQLbasedapplicationsbutneedtoget“alittlemore”outofthemMichaelWideniusMarchhttp:downzzbaikecomebook。http:downzzbaikecomebook。xiPrefaceWehadseveralgoalsinmindforthisbookManyofthemwerederivedfromthinkingaboutthatmythicalperfectMySQLbookthatnoneofushadreadbutthatwekeptlookingforonbookstoreshelvesOtherscamefromalotofexperiencehelpingotherusersputMySQLtoworkintheirenvironmentsWewantedabookthatwasn’tjustaSQLprimerWewantedabookwithatitlethatdidn’tstartorendinsomearbitrarytimeframe(“inThirtyDays,”“SevenDaysToaBetter”)anddidn’ttalkdowntothereaderMostofall,wewantedabookthatwouldhelpyoutakeyourskillstothenextlevelandbuildfast,reliablesystemswithMySQLonethatwouldanswerquestionslike“HowcanIsetupaclusterofMySQLserverscapableofhandlingmillionsuponmillionsofqueriesandensurethatthingskeeprunningevenifacoupleoftheserversdie”WedecidedtowriteabookthatfocusednotjustontheneedsoftheMySQLapplicationdeveloperbutalsoontherigorousdemandsoftheMySQLadministrator,whoneedstokeepthesystemupandrunningnomatterwhattheprogrammersorusersmaythrowattheserverHavingsaidthat,weassumethatyouarealreadyrelativelyexperiencedwithMySQLand,ideally,havereadanintroductorybookonitWealsoassumesomeexperiencewithgeneralsystemadministration,networking,andUnixlikeoperatingsystemsThisrevisedandexpandedsecondeditionincludesdeepercoverageofallthetopicsinthefirsteditionandmanynewtopicsaswellThisispartlyaresponsetothechangesthathavetakenplacesincethebookwasfirstpublished:MySQLisamuchlargerandmorecomplexpieceofsoftwarenowJustasimportantly,itspopularityhasexplodedTheMySQLcommunityhasgrownmuchlarger,andbigcorporationsarenowadoptingMySQLfortheirmissioncriticalapplicationsSincethefirstedition,MySQLhasbecomerecognizedasreadyfortheenterprise*Peoplearealso*Wethinkthisphraseismostlymarketingfluff,butitseemstoconveyasenseofimportancetoalotofpeoplehttp:downzzbaikecomebook。xii|PrefaceusingitmoreandmoreinapplicationsthatareexposedtotheInternet,wheredowntimeandotherproblemscannotbeconcealedortoleratedAsaresult,thissecondeditionhasaslightlydifferentfocusthanthefirsteditionWeemphasizereliabilityandcorrectnessjustasmuchasperformance,inpartbecausewehaveusedMySQLourselvesforapplicationswheresignificantamountsofmoneyareridingonthedatabaseserverWealsohavedeepexperienceinwebapplications,whereMySQLhasbecomeverypopularThesecondeditionspeakstotheexpandedworldofMySQL,whichdidn’texistinthesamewaywhenthefirsteditionwaswrittenHowThisBookIsOrganizedWefitalotofcomplicatedtopicsintothisbookHere,weexplainhowweputthemtogetherinanorderthatmakesthemeasiertolearnABroadOverviewChapter,MySQLArchitecture,isdedicatedtothebasicsthingsyou’llneedtobefamiliarwithbeforeyoudigindeeplyYouneedtounderstandhowMySQLisorganizedbeforeyou’llbeabletouseiteffectivelyThischapterexplainsMySQL’sarchitectureandkeyfactsaboutitsstorageenginesIthelpsyougetuptospeedifyouaren’tfamiliarwithsomeofthefundamentalsofarelationaldatabase,includingtransactionsThischapterwillalsobeusefulifthisbookisyourintroductiontoMySQLbutyou’realreadyfamiliarwithanotherdatabase,suchasOracleBuildingaSolidFoundationThenextfourchapterscovermaterialyou’llfindyourselfreferencingoverandoverasyouuseMySQLChapter,FindingBottlenecks:BenchmarkingandProfiling,discussesthebasicsofbenchmarkingandprofilingthatis,determiningwhatsortofworkloadyourservercanhandle,howfastitcanperformcertaintasks,andsoonYou’llwanttobenchmarkyourapplicationbothbeforeandafteranymajorchange,soyoucanjudgehoweffectiveyourchangesareWhatseemstobeapositivechangemayturnouttobeanegativeoneunderrealworldstress,andyou’llneverknowwhat’sreallycausingpoorperformanceunlessyoumeasureitaccuratelyInChapter,SchemaOptimizationandIndexing,wecoverthevariousnuancesofdatatypes,tabledesign,andindexesAwelldesignedschemahelpsMySQLperformmuchbetter,andmanyofthethingswediscussinlaterchaptershingeonhowwellyourapplicationputsMySQL’sindexestoworkAfirmunderstandingofindexesandhowtousethemwellisessentialforusingMySQLeffectively,soyou’llprobablyfindyourselfreturningtothischapterrepeatedlyhttp:downzzbaikecomebook。Preface|xiiiChapter,QueryPerformanceOptimization,explainshowMySQLexecutesqueriesandhowyoucantakeadvantageofitsqueryoptimizer’sstrengthsHavingafirmgraspofhowthequeryoptimizerworkswilldowondersforyourqueriesandwillhelpyouunderstandindexesbetter(IndexingandqueryoptimizationaresortofachickenandeggproblemreadingChapteragainafteryoureadChaptermightbeuseful)Thischapteralsopresentsspecificexamplesofvirtuallyallcommonclassesofqueries,illustratingwhereMySQLdoesagoodjobandhowtotransformqueriesintoformsthattakeadvantageofitsstrengthsUptothispoint,we’vecoveredthebasictopicsthatapplytoanydatabase:tables,indexes,data,andqueriesChapter,AdvancedMySQLFeatures,goesbeyondthebasicsandshowsyouhowMySQL’sadvancedfeaturesworkWeexaminethequerycache,storedprocedures,triggers,charactersets,andmoreMySQL’simplementationofthesefeaturesisdifferentfromotherdatabases,andagoodunderstandingofthemcanopenupnewopportunitiesforperformancegainsthatyoumightnothavethoughtaboutotherwiseTuningYourApplicationThenexttwochaptersdiscusshowtomakechangestoimproveyourMySQLbasedapplication’sperformanceInChapter,OptimizingServerSettings,wediscusshowyoucantuneMySQLtomakethemostofyourhardwareandtoworkaswellaspossibleforyourspecificapplicationChapter,OperatingSystemandHardwareOptimization,explainshowtogetthemostoutofyouroperatingsystemandhardwareWealsosuggesthardwareconfigurationsthatmayprovidebetterperformanceforlargerscaleapplicationsScalingUpwardAfterMakingChangesOneserverisn’talwaysenoughInChapter,Replication,wediscussreplicationthatis,gettingyourdatacopiedautomaticallytomultipleserversWhencombinedwiththescaling,loadbalancing,andhighavailabilitylessonsinChapter,ScalingandHighAvailability,thiswillprovideyouwiththegroundworkforscalingyourapplicationsaslargeasyouneedthemtobeAnapplicationthatrunsonalargescaleMySQLbackendoftenprovidessignificantopportunitiesforoptimizationintheapplicationitselfTherearebetterandworsewaystodesignlargeapplicationsWhilethisisn’ttheprimaryfocusofthebook,wedon’twantyoutospendallyourtimeconcentratingonMySQLChapter,ApplicationLevelOptimization,willhelpyoudiscoverthelowhangingfruitinyouroverallarchitecture,especiallyifit’sawebapplicationhttp:downzzbaikecomebook。xiv|PrefaceMakingYourApplicationReliableThebestdesigned,mostscalablearchitectureintheworldisnogoodifitcan’tsurvivepoweroutages,maliciousattacks,applicationbugsorprogrammermistakes,andotherdisastersInChapter,BackupandRecovery,wediscussvariousbackupandrecoverystrategiesforyourMySQLdatabasesThesestrategieswillhelpminimizeyourdowntimeintheeventofinevitablehardwarefailureandensurethatyourdatasurvivessuchcatastrophesChapter,Security,providesyouwithafirmgraspofsomeofthesecurityissuesinvolvedinrunningaMySQLserverMoreimportantly,weoffermanysuggestionstoallowyoutopreventoutsidepartiesfromharmingtheserversyou’vespentallthistimetryingtoconfigureandoptimizeWeexplainsomeoftherarelyexploredareasofdatabasesecurity,showingboththebenefitsandperformanceimpactsofvariouspracticesUsually,intermsofperformance,itpaystokeepsecuritypoliciessimpleMiscellaneousUsefulTopicsInthelastfewchaptersandthebook’sappendixes,wedelveintoseveraltopicsthateitherdon’t“fit”inanyoftheearlierchaptersorarereferencedoftenenoughinmultiplechaptersthattheydeserveabitofspecialattentionChapter,MySQLServerStatusshowsyouhowtoinspectyourMySQLserverKnowinghowtogetstatusinformationfromtheser

用户评论(0)

0/200

精彩专题

上传我的资料

每篇奖励 +2积分

资料评价:

/47
仅支持在线阅读

意见
反馈

立即扫码关注

爱问共享资料微信公众号

返回
顶部