MySQL Query Fetch Time increases when LEFT JOIN with big table

I am fetching the same amount of data with 2 different queries. However, one of them have a fetching time of ~x130 compared to the other. Being the only difference between the two queries a LEFT JOIN with a big table (4M rows).

Especifically, my problem goes like this:
I have table_a with 200K rows. table_b with 100 rows and table_c with 4M rows. The fields involved are indexed. table_a and table_c have a one to many cardinality.

My query looks something like this:

       SELECT           a.id        FROM           table_a a           LEFT JOIN table_b b ON b.id = a.b_id           LEFT JOIN table_c c ON c.id = b.c_id        GROUP BY a.id; 

MySQL Workbench tells me that this query takes ~4s of Duration and 130 seconds of Fetch Time. However, when I remove the second LEFT JOIN with the big table, the query takes <1s of Duration and <1s Fetch Time.

I clearly understand why the query duration is increased. I am doing a kinda heavy left join. But, my question is: Why the fetching time is so much higher, if the fetched data is the same?

I have already increased innodb_buffer_pool_size with no success.

I am working in MySQL 8.0.19, with innodb as tables engine.

Is there something I am missing here? Thanks in advance for the help!

UPDATE:
Removing the GROUP BY also improves the performance <1s of Duration and ~1s Fetch Time

How to fetch posts with offset in WordPress?

I have more than 100,000 posts and i fetch 20,000 posts in every page refresh, but now if i refresh the page i want to display new 20,000 posts rather than same.

Here is my Query

         $  args = array(             'post_type' => 'ebay_product',             'posts_per_page' => 20000,             'post_status' => array('publish'),             'orderby' => 'ID',             'order' => 'DESC'         ); 

Please help me to solve this issue. Any solution appreciated!

In a single cycle datapath, do decode and operand fetch occur simultaneously?

After instruction has been fetched, does it go to control unit and register file at the same time or one after the other? For example if the control unit and register read both have 80ps delay, and we’re calculating the total delay for a cycle, would we take their delay as 80ns(if they occur simultaneously) or if they happen one after the other so in that case delay of decode and operand fetch would be 160ns. Which one is correct?

Time study / Data fetch and input from database

Below is an example , where Blue is user input either entering/drop-down , Yellow is from the database that the user can pick from drop-down list and Green is automatically calculated by the system . Hopefully I'm getting my point across. If you worked on a similar project , I would really appreciate if you can share your examples / tutorials / experience you had making a web-page that takes in value and stores in a database , either SQL, MySQL, access or any DB and guide me please. Any…

Time study / Data fetch and input from database

WooCommerce and Membership: Can I fetch the membership from the product?

I am working on a membership system. We have added our own in-app-purchase (IAP) plugin to communicate with Apple, Amazon, Google Play and Roku. So far, everything is working as we expect. The issue I am currently having is when I validate the receipt, I want to fetch the membership plan from the product, not a subscription, although I could get it to use that if I must. I have tested with a subscription too but still no luck. Since this will be an automated verification system the subscription seems to be more of a hassle as a simple product seems more ideal for our use case.

I have tried using:

$  _membershipPlan = \wc_memberships_get_memberships_from_subscription($  _productObj); 

Where $ _productObj has been a simple product and a simple subscription but it never returns the membership.

What I am trying to do is once the reciept is validated, I fetch the WC_Product (product or subscription) then I want to see what membership is attached to it and apply this to the user.

I have searched for this in their Docs and on Google and I haven’t been able to find anything. My last resort would be to write my own WP_Query object to handle this, as it seems I might have to do.

Something to note, the method wc_memberships_get_memberships_from_subscription is looking for _subscription_id but the membership doesn’t even have this as meta for it. It does have _product_ids stored in a serialized array which will be annoying to query. Not sure why this would be the case but this is where I am stuck.

Hoping someone here would have a little insight on this or point me in the right direction.

Thank you for your time.

backbone fetch() not working

I’m trying to use the REST API with Backbone in a plugin. I’m working through the documentation and examples at: https://developer.wordpress.org/rest-api/using-the-rest-api/backbone-javascript-client/. The first example to create a post works as expected:

// Create a new post var post = new wp.api.models.Post( { title: 'This is a test post' } ); post.save(); a new post is created.

However the next example to fetch a post : var post = new wp.api.models.Post( {id:1} ); post.fetch( ); console.log(JSON.stringify(post));

Does nothing. I have tried different post ids including the one created with the previous code. I get no errors or warnings. Just nothing happens. Everything else I have read says this should work. Any suggestions?

Fetch likes count

I’m using Buddypress with rtmedia plugin. What I’m trying to achieve is to display total media likes count of each members’ gallery on their respective header. I tried this code but it always displays 0… Maybe someone can help

function custom_rtmedia_likes() {     global $  rtmedia;       $  likecount = intval( $  rtmedia->likes ); ?>   <p>     <span id="media-likes"><?php echo $  likecount; ?> Likes</span>   </p> <?php   }   add_action('bp_before_member_header_meta', 'custom_rtmedia_likes'); 

i want fetch json data in mysql

I am using MySQL version 5.6.41-84.1-log, I want to fetch single column of JSON data example: I want to fetch date only anyone give me the solution

id | amount_detail ---------------- 1  | {"1":{"amount":"1000","date":"2020-01-22","amount_discount":"0","amount_fine":"0","description":"paid Collected By: Super Admin","payment_mode":"Cash","inv_no":1}}