Tag: SQL

  • Gathering database performance with WP-CLI

    Gathering database performance with WP-CLI

    Discover how we employed WP-CLI to streamline the assessment of database server performance in WordPress, facilitating a more efficient profiling of SQL queries before and after crucial server upgrades.

  • Quick Tip: Get Size of Revisions in WordPress

    Quick Tip: Get Size of Revisions in WordPress

    Monitoring and managing data bloat in a WordPress site can be crucial. The introduction of the block editor has led to a surge in post revisions, which can clog up the database. Conducting a revision data audit using SQL queries can reveal the extent of unnecessary data accumulation, highlighting the importance of setting limits to…

  • Getting WordPress Database Size via WP-CLI

    Getting WordPress Database Size via WP-CLI

    A WordPress WP-CLI command `db-size` allows fetching database tables, their data, and index size in various formats. The command offers sorting options like total, table, data size, and index size. Use `–format` to adjust the output format (`table`, `csv`, `json`, `count`, `yaml`), and `–raw` for full byte size.

  • Quick Tip: Export WordPress SQL output via WP-CLI

    Quick Tip: Export WordPress SQL output via WP-CLI

    Learn how to run custom SQL queries on your WordPress database using a small WP-CLI command. The command supports different output formats like table, CSV, JSON, and more. Plus, it includes a dry run option for safety. No need to rely on `wp db query` anymore!

  • Converting CSV to SQL

    Converting CSV to SQL

    Learn how to convert CSV files into SQL statements using PHP. Avoid directly inserting data into a live database; follow a safer approach. See a PHP script example for converting CSV files into SQL inserts, with an output demonstration for an “airtravel.csv” sample. Use this script cautiously or as a starting point for similar tasks.