欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    河南新华印刷集团有限公司32.ppt

    • 资源ID:92251239       资源大小:306.50KB        全文页数:97页
    • 资源格式: PPT        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    河南新华印刷集团有限公司32.ppt

    Advanced Perl DBIMaking simple things easyand difficult things possible by Tim Bunce2 2Advanced DBI tutorial Tim BunceJuly 2003Topical Topicsl Speed Speed Speed!l Handling handles and binding valuesl Error checking and error handlingl Wheels within wheelsl Transactionsl DBI for the webl Taintingl Handling LONG/BLOB datal Portabilityl Proxy power and flexible multiplexl Whats new and whats planned3 3Advanced DBI tutorial Tim BunceJuly 2003Trimmed Topics and Tipsl Lack of time prevents the inclusion of.n Details of issues relating to specific databases and drivers(other than where used as examples of general issues)each driver would warrant a tutorial of its own!n Non-trivial worked examplesn Handy DBIx:*and other DBI related modulesn and anything Id not finished implementing when this was written.l But I hope youll agree that theres ample information in the following 90+slidesl Tips for those attending the conference tutorial:n Doodle notes from my whitterings about the whys and wherefores on your printed copy of the slides as we go along.4 4Advanced DBI tutorial Tim BunceJuly 2003The DBI-Whats it all about?l The Perl DBI defines and implements an interface to databasesl Plug-in driver modules do the database-specific workl DBI provides default methods,functions,tools etc for driversl Not limited to the lowest common denominatorl Designed and built for speedl Powerful automatic error checking built-inl Valuable detailed call tracing/debugging built-inl Useful detailed call profiling/benchmarking built-in5 5Advanced DBI tutorial Tim BunceJuly 2003DBI ModulePerl ApplicationDBD:Other DBD:Informix DBD:OracleOracle Server Informix Server Other ServerA picture is worth?Speed Speed Speed!What helps,what doesnt,and how to measure it7 7Advanced DBI tutorial Tim BunceJuly 2003Give me speed!l DBI was designed for speed from day onel DBI method dispatcher written in hand-crafted XS/Cl Dispatch to XS driver method calls is specially optimizedl Cached attributes returned directly by DBI dispatcherl DBI overhead is generally insignificant So well talk about other speed issues instead.8 8Advanced DBI tutorial Tim BunceJuly 2003Partition for speedl Application partitioning do what where?-stop and think-work smarter not hardern Pick the right database for the job,if you have the choice.n Work close to the data Moving data to/from the client is always expensive Consider latency as well as bandwidth Use stored procedures where appropriate Do more in SQL where appropriate-get a good bookn Multiple simple queries with joins in Perl may be faster.n Use proprietary bulk-load,not Perl,where appropriate.n Mix n Match techniques as needed experiment and do your own benchmarks.9 9Advanced DBI tutorial Tim BunceJuly 2003Prepare for speedl prepare()-what happens in the server.Receive and parse the SQL statement into internal form Get details for all the selected tables Check access rights for each Get details for all the selected fields Check data types in expressions Get details for the indices on all the fields in where/join clauses Develop an optimised query access plan for best execution Return a handle for all this cached informationn This can be an expensive process especially the access plan for a complex multi-table queryn Some databases,like MySQL,dont cache the information but have simpler,and thus faster,plan creation.10 10Advanced DBI tutorial Tim BunceJuly 2003How would you do it?l One possible approach:Select from one table using its key field(assume both tables have an index on key)Then,loop for each row returned,and.select from the other table using its key field and the current rows value fieldl But which table to select first?To keep it simple,assume that both tables have the same value in all rowsl If we know that t1.key=1 matches 1000 rows and t2.key=2 matches 1then we know that we should select from t2 firstbecause that way we only have to select from each table oncel If we selected from t1 firstthen wed have to select from t2 1000 times!l An alternative approach would be to select from both and merge.11 11Advanced DBI tutorial Tim BunceJuly 2003The best laid plansl Query optimisation is hard Intelligent high quality cost based query optimisation is really hard!l Know your optimiser Oracle,Informix,Sybase,DB2,SQL Server etc.all slightly different.l Check what its doing Use tools to see the plans used for your queries-very helpfull Help it alongn Most big name databases have a mechanism to analyse and store the key distributions of indices to help the optimiser make good plans.Most important for tables with skewed(uneven)key distributions Beware:keep it fresh,old key distributions might be worse than nonen Some also allow you to embed hints into the SQL as comments Beware:take it easy,over hinting hinders dynamic optimisation.

    注意事项

    本文(河南新华印刷集团有限公司32.ppt)为本站会员(e****s)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开