mysql – Need help with the indexes for 2 slow WordPress queries

Here are my 2 slow questions that I want to improve.

SELECT object_id, term_taxonomy_id
FROM wp_term_relationships
INNER JOIN wp_posts
ON object_id = ID
WHERE term_taxonomy_id IN (525627,516360,525519,535782,517555,525186,517572,549564,1,517754,541497,541472,525476,549563,517633,524859,702393,541604,543483,524646,525001,550518,541516,525244,549565,517376,535783,524642,25,533395,533537,525475,2,705306,524684,525065,939122,541603,525523,533491,541590,702713,550724,525243,533634,525122,541498,549586,546982,21,524643,541478,525435,535784,541471,516611,535781,541638,516142,533416,546984,524999,533453,524682,704994,516579,516189,524644,517378,525185,541508,517634,705305,524858,517632,541637,517699,525064,517573,772367,516609,517375,525474,507436,524918,517635,541929,22,54,53,705119,524685,524683,516577,536343,191228,524915,524917,516298,541573,546983,515904,541601,56,517377,524645,517707,515905,516297,515903,517708,533635,516296,516578,517750,517554,516016,525123,533538,541625,525187,705307,55,191226,19,24,516299,541466,524916,772366,555654,516612,541503,191227,550302,991853,920642,191229,535829,525582,525524,524919,524720,525841,517636,541504,525184,525520,541562,525433,541563,516610)
AND post_type IN ('post')
AND post_status = 'publish' +
_pad_term_counts()
Theme   259514  2.0440

SELECT wp_posts.ID
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND wp_posts.ID NOT IN (391534)
AND ( wp_term_relationships.term_taxonomy_id IN (2,516296,517375,517376,517377,517378,517554,517555,517572,517573,517632,517633,517634,517635,517636,517699,517707,517708,517750,517754,524858,524859,524915,524916,524917,524918,524919,524999,525001,525064,525065,525185,525186,525187,525519,525520,525523,525524,525582,525841,533395,533416,533453,535782,535783,535784,535829,536343,549563,549564,549565,549586,550302,550518,550724,555654,702393,702713,704994,705119,705305,705306,705307,772366,772367,920642,939122,991853) )
AND wp_posts.post_type = 'post'
AND ((wp_posts.post_status = 'publish'))
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 6

So I thought adding indexes for wp_term_relationships (object_id, term_taxonomy_id) and wp_posts (post_type, post_status, id, post_date) could improve this, but how?

Do you have any idea how to go about it?

mysql – How can I improve this slow query on my WordPress site?

SELECT object_id, term_taxonomy_id
FROM wp_term_relationships
INNER JOIN wp_posts
ON object_id = ID
WHERE term_taxonomy_id IN (525627,516360,525519,535782,517555,525186,517572,549564,1,517754,541497,541472,525476,549563,517633,524859,702393,541604,543483,524646,525001,550518,541516,525244,549565,517376,535783,524642,25,533395,533537,525475,2,705306,524684,525065,939122,541603,525523,533491,541590,702713,550724,525243,533634,525122,541498,549586,546982,21,524643,541478,525435,535784,541471,516611,535781,541638,516142,533416,546984,524999,533453,524682,704994,516579,516189,524644,517378,525185,541508,517634,705305,524858,517632,541637,517699,525064,517573,772367,516609,517375,525474,507436,524918,517635,541929,22,54,53,705119,524685,524683,516577,536343,191228,524915,524917,516298,541573,546983,515904,541601,56,517377,524645,517707,515905,516297,515903,517708,533635,516296,516578,517750,517554,516016,525123,533538,541625,525187,705307,55,191226,19,24,516299,541466,524916,772366,555654,516612,541503,191227,550302,991853,920642,191229,535829,525582,525524,524919,524720,525841,517636,541504,525184,525520,541562,525433,541563,516610)
AND post_type IN ('post')
AND post_status = 'publish' +
_pad_term_counts()
Theme   259514  2.0440

SELECT wp_posts.ID
FROM wp_posts
LEFT JOIN wp_term_relationships
ON (wp_posts.ID = wp_term_relationships.object_id)
WHERE 1=1
AND wp_posts.ID NOT IN (391534)
AND ( wp_term_relationships.term_taxonomy_id IN (2,516296,517375,517376,517377,517378,517554,517555,517572,517573,517632,517633,517634,517635,517636,517699,517707,517708,517750,517754,524858,524859,524915,524916,524917,524918,524919,524999,525001,525064,525065,525185,525186,525187,525519,525520,525523,525524,525582,525841,533395,533416,533453,535782,535783,535784,535829,536343,549563,549564,549565,549586,550302,550518,550724,555654,702393,702713,704994,705119,705305,705306,705307,772366,772367,920642,939122,991853) )
AND wp_posts.post_type = 'post'
AND ((wp_posts.post_status = 'publish'))
GROUP BY wp_posts.ID
ORDER BY wp_posts.post_date DESC
LIMIT 0, 6
How can I improve this query ? I have many posts and they are taking like 2secs each.

Thank you very much

I also found this additional information that I think would help …

Why do you think changing the WordPress core table is a good idea? –
Krzysiek Dróżdż ♦ Jun 12 '15 at 4:21 I really don't think it's good
Idea but a necessary one if WordPress is executed with the number of posts
and combined with the limitations of MySQL not descending
Index function. The file sorts caused by the order of operations are
a deal breaker for us in terms of local performance. – Ranknoodle Jun
15 & # 39; 15 at 2:34 But these operations are slow since you are doing it
not correct. We had similar problems in some projects, but came too much
other solution that has not changed core tables. We have created ours
own table and used as indexing / search table. So every slow query
only searched based on this one table (no joins required). (And we
had a lot more data, AFAIR) – Krzysiek Dróżdż ♦ June 15, 15 at 5:06 am Hello
KRZYSIEK, you can explain a little more about indexing search tables
you created? For example, the slow query contour in the original
Question, I would create a spreadsheet to save the post
ID, reverse_post_id, post_type etc and just ask for it? –
Ranknoodle Jun 15th 15 at 4:31 pm send me an email, i will try to
Explain this method. – Krzysiek Dróżdż ♦ June 15 at 4:34 p.m.

But no idea what method he was using.

I will optimize your website for $ 25 for SEO optimization in WordPress

I optimize your website with WordPress SEO

Important: This gig is only for WordPress.org websites with separate hosting or for WordPress.com with Business Plan or higher! If you want to get more traffic for your website and a better rank, then My 9 Years is the right experience for you in WordPress and SEOI will do the full On Page WordPress SEO optimization for your site. Customize your WordPress site with the Yoast WordPress plugin with professional settings & Twitter meta CardsRobots.txt OptimizationBreadcrumbs OptimizationAll Of Above Including (Basic) Homepage OptimizationKeyword ResearchAdjust your permalink settingsInstall the tools of Google and Bing Webmasters to analyze your trafficAutomate backupsSpeed ​​optimizationBroken links optimization
Thank you very much.

(tagsToTranslate) wordpres (t) seo (t) service (t) yoast (t) seopress

Buy – WordPress Designer / changes required

We have the latest WordPress installed and use the following topic:
SEMrush

https://themeforest.net/item/ftage-movie-film-marketing-wordpress-theme/20705434

We need to have the following things done at the site and do them fairly quickly.

1) We need to edit the inside of the "Services" section and create a common "design" on all of the service pages. We just have to create a good design for them across the board.

Then we also need to install and set up some plugins to do the following things.

* We have delivered the equipment to the tenants, so we need an installed and set up plugin that allows us to enter all of our inventory and prices and order online, including shipping information or pickup etc. Also the main thing we need to remember The longer you rent our equipment, the cheaper it gets. This must be part of the functionality. We also have several units for some of our devices, so this must be taken into account.

* We also want to use a subdomain on our site for internal purposes. We want to be able to create a subdomain with a different WordPress account (doesn't need to be installed on the same installation as the main site) where our in-house staff can manage inventory and log things in. For example, we have devices and items that we want to enter, and make sure that whenever one of our employees receives them, they log on and off. This way we know where they are, who last had them, etc.

* We also need to create a fundraising page for various projects for which we collect donations. You have to be able to accept certain terms of use for donations and we have to be able to add different packages to fundraising, almost like crowdfunding.

If you are interested, send me a PM here with examples of your work, your QUOTE and Skype information and the length of time you need.

Is 512 MB RAM enough for 20 WordPress addon domains?

Is 512 MB RAM enough for 20 WordPress addon domains? | Web hosting talk

& # 39);
var sidebar_align = & # 39; right & # 39 ;;
var content_container_margin = parseInt (& # 39; 350px & # 39;);
var sidebar_width = parseInt (& # 39; 330px & # 39;);
// ->

  1. Is 512 MB RAM enough for 20 WordPress addon domains?

    Hi Guys,
    A well-known hosting service from my country (Brazil) is now for sale for $ 46.75 (4 years of hosting + 1 year of free domain .com). However, the hosting server runs on a 512-RAM single-core CPU.
    I work with ads on Facebook and Google and have to host several WordPress websites. These websites have only one page (advertorial page) with information and pictures about the product. The cash register itself is hosted on a large corporate website that I am connected to. I expect at least 1000 people / day on each of these sites. And I use 3 plugins: one for capturing and forwarding emails, one for the contact form and one for creating the pages (Elementor).
    I would like to know if this setup works because it is very much and I have run out of money lately.

    thank you in advance


  2. 512 MB RAM for every 20 WordPress is not enough, especially if you get more traffic.

    Specifically 4 you ||| Not throttled
    ,
    JoneSolutions.Com (Jones.Solutions or Jones.Hosting) is on the network Make available 24/7 stable and reliable Web hosting solutions and services since 2001


Similar topics

  1. Reply: 14

    Last contribution: 12-10-2014, 02.09 a.m.

  2. Reply: 16

    Last contribution: 6/18/2012, 1:16 a.m.

  3. Reply: 34

    Last contribution: 09-04-2009, 4:52 a.m.

  4. Reply: 11

    Last contribution: 7/15/2009, 1:41 am

  5. Reply: 13

    Last contribution: 27/02/2009, 8:29 pm

Tags for this thread

Publish permissions

  • You not allowed post new topics
  • You not allowed Post responses
  • You not allowed Post attachments
  • You not allowed Edit your posts




WordPress developers

Hi there,

I need someone to display WordPress posts on a non-WordPress site.

(I need to run the loop outside of WordPress)

WordPress is installed on domain.com/blog/.
I need posts to appear on domain.com

Please let us know your prices and dates.

noindex – WordPress / Yoast: How do I solve the pagination page problem?

Before I switched to YOAST, I used all-in-one SEO, but I have some big problems with it. There were incompatibilities that made it impossible to continue using this plugin.

In any case, I have a problem paginating my website. Here is the example:

Start: http://www.wildsolutions.at

Pagination: http://www.wildsolutions.at/page/2

This / page / 2 creates problems related to SEO: duplicate content, double h1, double description and so on.

With all in one SEO I was able to put a term on no subsequent pages / no index pages. I can't find anything comparable in YOAST.

I think that's a general WordPress thing.

I was able to find a "solution" for this, but that brings up another problem.

If I change the settings of permalinks from "postname" to "default" -> the page disappears / 2. But then the links of my pages are not nice to read (p? = 123). Take a look at the example.
Post name in the settings for permalinks
Broken links after switching to standard in permalinks

Can you tell me how to solve this problem?

Thanks in advance and greetings,
Philip

PHP – Update all WordPress posts

I have a WordPress film and series motif that I want to use to create a function that I can use to update the information of all posts. So I need to get all the WordPress post IDs and know how to do it. But there is a problem; When I use arguments captured in the function I wrote for this task, only some of the posts are updated.

the functionOMDb.php:
Function update_info_all () {
if (current_user_can (& # 39; edit_posts & # 39;)) {
if (! isset ($ _POST (& # 39; send-update-nonce & # 39;)) and! wp_verify_nonce ($ _POST (& # 39; send-update-nonce & # 39;), & # 39; send-update & # 39;)) {

        // Get All WP Post Type Post
        $post_type_post = array(
            'post_type' => 'post',
            'post_status' => 'publish',
            'posts_per_page'  => -1,
        );

        // Start The Loop for Update Post Meta
        $the_query = new WP_Query($post_type_post);
        if ($the_query->have_posts()){
            while ($the_query->have_posts()){
                $the_query->the_post();

                // Get All Post IDs
                $post_id = get_the_ID();

                // Get All Movie IDs
                $id_film = get_field('id_imdb_film' ,$post_id);

                // Get All Series IDs
                $id_serial = get_field('id_series_meta', $post_id);

                // If Type is Post(Movie)
                var_dump($id_film);
                var_dump($post_id);


                    // ========== SET Our APis ========== //
                    $get_json_movie = file_get_contents("http://www.omdbapi.com/?apikey=ba9e1d33&i=$id_film");
                    $data_movie = json_decode($get_json_movie, true);

                    $get_json_movie1 = file_get_contents("https://www.myapifilms.com/imdb/idIMDB?idIMDB=$id_film&data=0&token=4f7df7f1-e77d-47e4-bb3f-fc39bfd8c801&format=json");
                    $result2244 = json_decode($get_json_movie1, true);
                    $data_movie_2 = $result2244('data')('movies')('0');

                    $top_250 = "https://www.myapifilms.com/imdb/top?start=1&end=250&token=4f7df7f1-e77d-47e4-bb3f-fc39bfd8c801&format=json&data=1";
                    $get_json_movie2 = file_get_contents($top_250);
                    $the_json22 = json_decode($get_json_movie2, true);
                    $data_movie_3 = $the_json22('data')('movies');

                    $get_json_movie3 = file_get_contents("http://db.rizweb.ir/3/movie/$id_film?api_key=c8df48be0b9d3f1ed59ee365855e663a&language=fa");
                    $api_tmdb111 = json_decode($get_json_movie3,true);
                    $data_movie_4 = $api_tmdb111;


                    // ========== Now WE Can Update All Posts Meta ========== //
                    update_post_meta($post_id,'title_english',$data_movie_2('title')); // Title
                    update_post_meta($post_id,'release_date',$data_movie('Year')); // Year
                    update_post_meta($post_id,'film_release_date',smart_translate_value('mah',$data_movie('Released'))); // Release Date
                    update_post_meta($post_id,'imdb_rating',$data_movie_2('rating')); // IMDb Ratings
                    update_post_meta($post_id,'imdbvotecount',$data_movie('imdbVotes')); // IMDb Vote Count
                    update_post_meta($post_id,'metascore_film',$data_movie('Metascore')); // Metacritic
                    foreach ($data_movie('Ratings') as $toma){
                        $so_to = $toma('Source');
                        if ($so_to == 'Rotten Tomatoes'){
                            $to_so = $toma('Value');
                            $rotten_toma = str_replace('%','',$to_so);
                        }
                    }
                    update_post_meta($post_id,'film_rotten_rating',$rotten_toma); // Rotten Tomatoes
                    update_post_meta($post_id,'film_language',$data_movie('Language')); // Language
                    update_post_meta($post_id,'runtime',str_replace( 'min', 'دقیقه', $data_movie_2('runtime'))); // Runtime
                    update_post_meta($post_id,'rated_meta',$data_movie_2('rated')); // Rate
                    $budget_movie = '$'.number_format($data_movie_4('budget'),'0','',',');
                    update_post_meta($post_id,'film_budget',$budget_movie); // Budget
                    $revenue_movie = '$'.number_format($data_movie_4('revenue'),'0','',',');
                    update_post_meta($post_id,'film_sales',$revenue_movie); // Sales
                    foreach ($data_movie_3 as $not_movie){
                        if ($not_movie('idIMDB') == $id_film){
                            $rank_movie = $not_movie('ranking');
                            update_post_meta($post_id,'t250',$rank_movie);
                        }
                    }




                // If Type is Series


                    // SET Our APis
                    $get_json_series = file_get_contents("http://www.omdbapi.com/?apikey=ba9e1d33&i=$id_serial&type=series");
                    $data_serial = json_decode($get_json_series, true);

                    // Now WE Can Update All Posts Meta
                    update_post_meta($post_id,'title_english_s',$data_serial('Title'));


            }
        }
    }
}
die();

}
add_action (& # 39; wp_ajax_update_info_all & # 39 ;, & # 39; update_info_all & # 39;);

the ajax-omdb.js:
$ (& # 39; # sendAjax3 & # 39;). click (function () {

    // Set Var
    var btn_upd = $('.form .radio-btn button');
    var notice_line = $('.result-update .update-notice');
    var up_box = $('.result-update .update-status');
    var eq1 = $('.result-update .update-status .type_box .eq strong');
    var eq2 = $('.result-update .update-status .type_box .eq2 strong');
    var bar_line = $('.result-update #process_bar');

    jQuery.ajax({
        url: FXapi.url,
        type: 'POST',
        data: {
            'action' : 'update_info_all',
            'nonce' : 'send-update-nonce'
        },
        beforeSend : function () {
            btn_upd.text('در حال بروزرسانی...');
            $('.result-update').fadeIn();
            notice_line.text(FXapi.is_updating).css('color' , '#404040');
            up_box.fadeOut(10);
            bar_line.width('0%');
        },
        success : function (response) {
            $('.result-update #my-up-display').html(response);
            btn_upd.text('بروزرسانی اطلاعات');
            $('.result-update').fadeIn();
            notice_line.text(FXapi.success).css('color' , 'green');
            bar_line.width('100%');
            up_box.fadeIn();
            eq1.text(FXapi.total_post);
            eq2.text(FXapi.total_series);
        },
        error: function () {
            btn_upd.text('بروزرسانی اطلاعات');
            notice_line.text(FXapi.error);
        }
    });
});

DreamProxies - Cheapest USA Elite Private Proxies 100 Private Proxies 200 Private Proxies 400 Private Proxies 1000 Private Proxies 2000 Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies ProxiesLive Proxies-free.com New Proxy Lists Every Day Proxies123