Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6649359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:45:52+00:00 2026-05-26T00:45:52+00:00

can anyone can help me optimize this query and help me to tune my

  • 0

can anyone can help me optimize this query and help me to tune my my.cnf file?

SELECT 
  rf_row_id, 
  pf_id,
  pf_wordpress_url, 
  pf_merchant_logo, 
  rf_desc, 
  rf_manufacturer, 
  rf_product_name, 
  rf_small_image, 
  rf_price,
  pf_name,
  rf_shipping_handling_cost, 
  pf_voucher_code_expiry_date,
  pf_voucher_code,
  pf_voucher_code_instructions,
  rf_last_modified,
  pf_last_update,
  rf_deep_link,
  pf_delivery_free_from,
  pf_voucher_code_url,
  pf_delivery_string,
  pf_delivery_fee_2 
FROM raw_feed, product_feeds 
WHERE pf_id=rf_feed_id 
AND ( rf_search_index LIKE '%C4838AE%' OR rf_search_index LIKE '%HP11%')
GROUP BY rf_feed_id, rf_product_id ORDER BY rf_price ASC

It takes around 5 sec to execute after i restart server and query isn’t in chache.
I have indexes at:
table product_feeds to pf_id (Primary) column
table raw_feed to rf_row_id (Primary) and rf_search_index column

After EXPLAIN I get:

*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: raw_feed
         type: ALL
possible_keys: NULL
          key: NULL
      key_len: NULL
          ref: NULL
         rows: 263804
        Extra: Using where; Using temporary; Using filesort
*************************** 2. row ***************************
           id: 1
  select_type: SIMPLE
        table: product_feeds
         type: eq_ref
possible_keys: PRIMARY
          key: PRIMARY
      key_len: 2
          ref: usrdb_rnbx.raw_feed.rf_feed_id
         rows: 1
        Extra:

Don’t know why key for first row is null?! What indexes should I create?

I have 263,804 total rows in raw_feed table and 50 rows in product_feeds table.

MY.CNF file: ()

[mysqld]
basedir=/opt/bitnami/mysql
character-set-server=UTF8
collation-server=utf8_general_ci
datadir=/opt/bitnami/mysql/data
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
tmpdir=/opt/bitnami/mysql/tmp
set-variable = max_connections=3096
set-variable = max_allowed_packet=15M
key_buffer = 1024M
key_buffer_size = 1024M
table_cache = 1024
sort_buffer_size = 50M
read_buffer_size = 50M
read_rnd_buffer_size = 16M
myisam_sort_buffer_size = 3M
thread_cache = 32
thread_concurrency = 16
open-files-limit= 261424
set-variable = thread_stack=512k
set-variable = query_cache_size=128M
set-variable = wait_timeout=120
set-variable = interactive_timeout=60
set-variable = max_connect_errors=999999 

Can anyone help me to reconfigure this file and help me with query?

I use amazon aws ec2 small instance with 10GB root storage, 1.7GB (RAM?) memory

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:45:53+00:00Added an answer on May 26, 2026 at 12:45 am

    LIKE with a percent at the beginning can’t use an index in MySQL. This is because MySQL needs to know the start of the string in order to look it up in its index (thats a limitation of how MySQL does indices, and actually of most database products). So, the best MySQL can do is scan raw_feed—which is what its doing.

    You need to find another way to do that search. One option would be (assuming you’re using MyISAM, which is probably right from your my.cnf) built-in fulltext search. Another would be, e.g., Sphinx.

    Also, your my.cnf settings are weird (tempted to say “insane”). Your key_buffer is way to large for a system with 1.7G of RAM. But MySQL tuning is probably best asked on Serverfault.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me rewrite this query without a distinct clause? select a.rec_type ,
Can anyone help me how to optimize this method? public override VirtualPathData GetVirtualPath(RequestContext requestContext,
Can anyone help me with this CAML query? When I flip the Ascending attribute
Can anyone help with with the time complexity of this algorithm, and why it
can anyone help? I have a simple html file which i am filling via
Can anyone help with this... vector<unsigned int> *vVec = new vector<unsigned int>; vVec .reserve(frankReservedSpace);
Can anyone help me figure this out? The below code works fine and gets
Can anyone help me to convert this to proper JavaScript? <script>var datePostForAll = &#39;<div
Can anyone help me on how i can achieve this style for android ?
can anyone help? I have small procedure to read in an UTF-8 file with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.