资源描述:
《关于继续开设车工专业的调研论证报告...》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、SphinxHigh-performancefull-textsearchforMySQLAndrewAksyonoff,shodan@shodan.ruPeterZaitsev,pz@percona.comWhat’sSphinx?FOSSfull-textsearchengineSpeciallydesignedforindexingdatabasesIntegrateswellwithMySQLProvidesgreatlyimprovedfull-textsearchSometimes,canimprovenon-full-textquer
2、iesBymoreefficientprocessing(insomecases)Bydistributedprocessingonacluster(inall)DetailslaterinthistalkWhySphinx?MajorreasonsBetterindexingspeedBettersearchingspeedBetterrelevanceBetterscalability“Minor”reasonsManyotherfeaturesLikefixedRAMusage,“faceted”searching,geo-distance,
3、built-inHTMLstripper,morphologysupport,1-grams,snippetshighlighting,etc.Themeaningof“better”Betterindexingspeed50-100timesfasterthanMySQLFULLTEXT4-10timesfasterthanotherexternalenginesBettersearchingspeedHeavilydependsonthemode(booleanvs.phrase)andadditionalprocessing(WHERE,OR
4、DERBY,etc)Upto1000(!)timesfasterthanMySQLFULLTEXTinextremecases(eg.largeresultsetwithGROUPBY)Upto2-10timesfasterthanotherexternalenginesThemeaningof“better”2.0BetterrelevancySphinxphrase-basedrankinginadditiontoclassicstatisticalBM25Samplequery–“Tobeornottobe”Optional,canbetur
5、nedoffforperformanceBetterscalabilityVertical–canutilizemanyCPUcores,manyHDDsHorizontal–canutilizemanyserversOutoftheboxsupportTransparenttoapp,matterofserverconfigchangesHowdoesitscale?DistributedsearchingwithseveralmachinesFullytransparenttocallingapplicationBiggestknownSphi
6、nxcluster1,200,000,000+documents(yes,that’sabillion)1.5terabytes1+millionsearches/day7boxesx2dual-coreCPUs=28coresBusiestknownSphinxcluster30+millionsearches/dayusing15boxesHowdoesitwork?Twostandaloneprogramsindexer–pullsdatafromDB,buildsindexessearchd–usesindexes,answersqueri
7、esClientprogramstalktosearchdoverTCPVianativeAPIs(PHP,Perl,Python,Ruby,Java)...ViaSphinxSE,pluggableMySQLengineindexerperiodicallyrebuildstheindexesTypically,usingcronjobsSearchingworksOKduringrebuildsIndexingworkflowDatasources–“wheretogetthedata?”MySQL,Postgres,XMLpipe…Local
8、indexes–“howtoindexthedata?”Alsostoragelocation,validcharacte