SlideShare uma empresa Scribd logo
1 de 15
Datenbank
                          optimieren -
                           WordPress
                         beschleunigen


Montag, 25. Februar 13
Inhalt

                  • Datenmüll
                  • Optimierung mit MySQL
                  • Optimierung mit Plug-ins
                  • Proaktive Optimierung
                  • Fazit

               Code-Beispiele orientieren sich an einer Default-Installation von WordPress. Nicht zu Empfehlen.

Montag, 25. Februar 13
http://codex.wordpress.org/File:WP3.0-ERD.png

Montag, 25. Februar 13
Datenmüll

                  • Restdaten von Plug-ins
                  • SPAM-Kommentare
                  • Blockierte Kommentare
                  • Revisionen
                  • weitere ...


Montag, 25. Februar 13
Optimierung mit MySQL
                  • Löschung aller Revisionen
                         DELETE FROM wp_posts

                         WHERE post_type LIKE `revision`

                  • Löschung von SPAM-Kommentaren
                         DELETE FROM wp_comments

                         WHERE comment_approved LIKE `spam`

                         -- trash / hold / approve

Montag, 25. Februar 13
Optimierung mit MySQL
                  • Löschung loser Verknüpfungen
                         wp_postmeta
                         DELETE meta

                         FROM wp_postmeta AS meta

                         LEFT JOIN wp_posts AS post

                         ON (post.ID = meta.post_id)

                         WHERE post.ID IS NULL


Montag, 25. Februar 13
Optimierung mit MySQL
                  • Löschung loser Verknüpfungen
                         wp_commentmeta
                         DELETE meta

                         FROM wp_commentmeta AS meta

                         LEFT JOIN wp_comments AS comment

                         ON (comment.comment_ID =
                         meta.comment_id)

                         WHERE comment.comment_ID IS NULL

Montag, 25. Februar 13
Optimierung mit MySQL

              • Defragmentierung der Tables
                         OPTIMIZE TABLE wp_commentmeta,
                         wp_comments, wp_links, wp_options,
                         wp_postmeta, wp_posts, wp_terms,
                         wp_term_relationships,
                         wp_term_taxonomy, wp_userdata,
                         wp_users




Montag, 25. Februar 13
Optimierung mit MySQL

              • Adminer
                     http://wordpress.org/extend/plugins/
                     adminer/
              • Sequel Pro
                     http://www.sequelpro.com/
              • phpmyadmin


Montag, 25. Februar 13
Optimierung mit Plug-ins

              • WP Database Cleaner
                     http://wordpress.org/extend/plugins/wp-database-cleaner


              • WP-Optimize
                     http://wordpress.org/extend/plugins/wp-optimize/


              • WP Clean Up
                     http://wordpress.org/extend/plugins/wp-clean-up/




Montag, 25. Februar 13
Proaktive Optimierung
              • Testsystem für Themes & Plug-ins
              • Revisionen einschränken
                     (wp_config.php)
                     define(`WP_POST_REVISIONS`, 5);

                     define(`WP_POST_REVISIONS`, false);

                     define(`AUTOSAVE_INTERVAL`, 200);




Montag, 25. Februar 13
Proaktive Optimierung

              • Kommentarfunktion einschränken
                     (Einstellungen/Diskussion)
              • AutoSave einschränken
                     (Plug-in / function.php)
                     function fb_disable_autosave()
                     { wp_deregister_script( 'autosave' ); }
                     add_action( 'wp_print_scripts','fb_disable_autosave' );

                     (Quelle: http://bueltge.de/wordpress-autosave-beeinflussen/613/)




Montag, 25. Februar 13
Fazit

              • Aufgeräumter (WP-Backend)
              • Schneller (DB-Zugriffe)
              • weniger Datenvolumen (Speicher)
              • weitere ...



Montag, 25. Februar 13
Danke.



Montag, 25. Februar 13
Ergänzungen am Abend


                     define('EMPTY_TRASH_DAYS', 10);

              • Trash get auch mit 0, revisions auch
                     mit Zahl für Tage.

                     (Quelle: https://twitter.com/glueckpress/status/303934846131138560)




Montag, 25. Februar 13

Mais conteúdo relacionado

Destaque

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

DB Optimierung - WordPress beschleunigen

  • 1. Datenbank optimieren - WordPress beschleunigen Montag, 25. Februar 13
  • 2. Inhalt • Datenmüll • Optimierung mit MySQL • Optimierung mit Plug-ins • Proaktive Optimierung • Fazit Code-Beispiele orientieren sich an einer Default-Installation von WordPress. Nicht zu Empfehlen. Montag, 25. Februar 13
  • 4. Datenmüll • Restdaten von Plug-ins • SPAM-Kommentare • Blockierte Kommentare • Revisionen • weitere ... Montag, 25. Februar 13
  • 5. Optimierung mit MySQL • Löschung aller Revisionen DELETE FROM wp_posts WHERE post_type LIKE `revision` • Löschung von SPAM-Kommentaren DELETE FROM wp_comments WHERE comment_approved LIKE `spam` -- trash / hold / approve Montag, 25. Februar 13
  • 6. Optimierung mit MySQL • Löschung loser Verknüpfungen wp_postmeta DELETE meta FROM wp_postmeta AS meta LEFT JOIN wp_posts AS post ON (post.ID = meta.post_id) WHERE post.ID IS NULL Montag, 25. Februar 13
  • 7. Optimierung mit MySQL • Löschung loser Verknüpfungen wp_commentmeta DELETE meta FROM wp_commentmeta AS meta LEFT JOIN wp_comments AS comment ON (comment.comment_ID = meta.comment_id) WHERE comment.comment_ID IS NULL Montag, 25. Februar 13
  • 8. Optimierung mit MySQL • Defragmentierung der Tables OPTIMIZE TABLE wp_commentmeta, wp_comments, wp_links, wp_options, wp_postmeta, wp_posts, wp_terms, wp_term_relationships, wp_term_taxonomy, wp_userdata, wp_users Montag, 25. Februar 13
  • 9. Optimierung mit MySQL • Adminer http://wordpress.org/extend/plugins/ adminer/ • Sequel Pro http://www.sequelpro.com/ • phpmyadmin Montag, 25. Februar 13
  • 10. Optimierung mit Plug-ins • WP Database Cleaner http://wordpress.org/extend/plugins/wp-database-cleaner • WP-Optimize http://wordpress.org/extend/plugins/wp-optimize/ • WP Clean Up http://wordpress.org/extend/plugins/wp-clean-up/ Montag, 25. Februar 13
  • 11. Proaktive Optimierung • Testsystem für Themes & Plug-ins • Revisionen einschränken (wp_config.php) define(`WP_POST_REVISIONS`, 5); define(`WP_POST_REVISIONS`, false); define(`AUTOSAVE_INTERVAL`, 200); Montag, 25. Februar 13
  • 12. Proaktive Optimierung • Kommentarfunktion einschränken (Einstellungen/Diskussion) • AutoSave einschränken (Plug-in / function.php) function fb_disable_autosave() { wp_deregister_script( 'autosave' ); } add_action( 'wp_print_scripts','fb_disable_autosave' ); (Quelle: http://bueltge.de/wordpress-autosave-beeinflussen/613/) Montag, 25. Februar 13
  • 13. Fazit • Aufgeräumter (WP-Backend) • Schneller (DB-Zugriffe) • weniger Datenvolumen (Speicher) • weitere ... Montag, 25. Februar 13
  • 15. Ergänzungen am Abend define('EMPTY_TRASH_DAYS', 10); • Trash get auch mit 0, revisions auch mit Zahl für Tage. (Quelle: https://twitter.com/glueckpress/status/303934846131138560) Montag, 25. Februar 13