There is a significant amount of memory usage if you use the $wpdb for queries that return very large result sets. $wpdb loads the entire results from any given query into memory. So if you’re, say, selecting all the posts, then it’ll try to load the whole thing into memory immediately.
So for something like a backup plugin, direct calls to mySQL with loops for retrieving the data make more sense.
Related Posts:
- Using wpdb to connect to a separate database
- WPDB Insert or if exists Update
- get_results using wpdb
- $wpdb won’t insert NULL into table column
- Get error messages when $wpdb->insert() returns false?
- Does dbDelta delete columns as well?
- How to fetch Data in WordPress using MySQLi or $wpdb
- wpdb->insert multiple record at once
- How to define composite keys with dbDelta()
- Why does $wpdb return strings for mysql integer values?
- $wpdb->prepare() warning in WordPress 3.5
- Inserting data into custom tables
- Hook into $wpdb
- Display data from a non wordpress database on a page template
- How does $wpdb handle COUNT(*)
- WordPress database error: [Query was empty] [closed]
- Inserting Post Meta From SQL
- Connecting to external oracle database
- Faulty restore of the database, encoding issue
- Can’t save ajax value to database
- What causes the “max_user_connections” warning on WordPress frontend?
- $wpdb variable throw this error Call to a member function get_results() on a non-object in
- Updating all rows of table with $wpdb
- How to execute mulitple statement SQL queries using $wpdb->query?
- Is $wpdb->prepare escaping to much? How to use it properly?
- When and why should I use $wpdb different return types?
- WordPress and automated MySQL backups to a different host
- How wordpress accesses its own database
- Remove database entries where post_date > expiration date
- Backup another database with BackUpWordPress plugin [closed]
- Get data from database using $WPDB
- How to use a different database to list and manage comments in the backend
- Getting all the users who have author privilege
- wpdb_prepare with multiple or condition
- For WordPress is there content in the database which I can safely ignore?
- Show last modified date of database
- $wpdb->insert is not working
- Extracting the post_id via the wp_insert_post action (external db query)
- In what part of the WordPress core does the users table and usermeta table get joined?
- WordPress choose wrong database
- Create table from array with prepare
- Update from 4.5 to 4.6 failing
- Does WordPress $wpdb functions wait when table is locked?
- $wpdb->insert Giving duplicates
- I’m not able to get access to $wpdb [duplicate]
- Where is phpMyAdmin inside WordPress?
- Have working sql query… trying to adjust it to use $wpdb
- How to backup my site and restore my wordpress site
- Cannot restore wordpress database from sql dump [closed]
- Problem in using wpdb
- $wpdb->query can’t insert data
- How to fetch records from database WordPress
- wordpress database restore – broken link
- restore a db after bad backup
- Best practice to import user base (subscribers) from one website to another?
- AJAX wp-mysql running too slow
- Problem migrating to localhost
- Clear Terms from Taxonomy for Specific Post IDs?
- Connecting to a different database
- Query Column of Specific ID from Database Table
- How to delete a particular row in a database table
- How to create more than one new wpdb object?
- Update multiple rows in one query
- How to connect and insert data in database of wordpress?
- Should I use an additional column in the DB?
- access JSON results from wordpress database with wpdb
- Getting value from database table depending on field value
- wpdb->insert not inserting first variable
- How do I have a user upload a blog post and then retrieve that to display in a card on the site?
- How to escape percentage sign(%) in sql query with $wpdb->prepare?
- wpdb Insert unknown post data dynamic foreach loop
- How do I get database rows from a custom table using wpdb?
- How can i restore a WordPress site with the DB and WordPress Files
- Help with $wpdb on custom code
- “BS_” rows in postmeta table
- How to rerieve comments and their replies from DB
- is it possible to install new WordPress in an old WordPress folder?
- Help posting values to DB on submit using $wpdb->query
- How to add download link from database on custom page template?
- 2 $wpdb queries causing error Table ‘wp_postmeta’ is specified twice, both as a target for ‘UPDATE’
- WPCLI search and replace in a particlar site dir effect another site-dir
- insert data from a form:: Warning Empty query mysqli::query()
- How can I get $wpdb to show MySQL warnings?
- About wp database hooks (error establishing connection)
- How to get specific table by current user login
- How do I find out from my database what version of WordPress I need?
- How To connect to the same WordPress database with different database user
- Accessing content from third party as native posts in WordPress
- Should I Use only wpdb Class to Write Custom Queries?
- Copy WordPress to new directory
- I have include wp-config, should I add global $wpdb also?
- Can’t Install WordPress (local) Failed to open file wp-includes/wp-db.php
- version control for wordpress? (wordpress folder and database at same time)
- using same mysql user with many databases
- Pulling values from a sepcific row in table
- Inserting into data into external DB using WPDB
- Insert Extra fields added in the front end registration form to DB
- $wpdb->insert not working for last select option
- What’s the cleanest way to transfer WordPress to a new server
- Uploading to WordPress Database