Opened 15 years ago
Closed 15 years ago
#4589 closed defect (bug) (fixed)
Export post query memory usage
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
The export function uses a get_results() call that loads the entire posts table into memory. The result is stored in $wpdb->last_result and a second copy is returned by the get_results() function, so memory usage is at least double the table size.
The enclosed patch alters the export post loop to fetch 20 posts from the table at a time.
FYI, I considered using an offset/limit increment loop, but that could cause sync problems if a new post is added during the export loop. The $post_ids method used here is a little ugly but works fine. An ideal solution might be to provide an alternate get_results() db query mode that doesn't return the entire resultset as an array.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
(In [5785]) Reduce export mem usage. Props tellyworth. fixes #4589