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 6198711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:03:50+00:00 2026-05-24T04:03:50+00:00

Basically we have sales people that request leads to call. Right now it tried

  • 0

Basically we have sales people that request leads to call. Right now it tried a “fresh lead” query to get those.

If there aren’t any fresh leads it moves on to a “relatively new” query. We call these “sources” and essentially a closer will go through sources until they find a viable lead.

These queries all query the same table, just different groups of data. However, there is a lot of complex sorting on each query and between that and inserts/updates to the table (table being InnoDB) we’re experience lots of waits (no deadlocks i’m pretty sure since they don’t show in InnoDB status) so my guess is we have slow selects, coupled with lots of inserts/updates.

NOW, the ultimate question IS:

Should we query the DB for each source and grab about 100ish (obviously variable depending on the system) and cache them in memcached. Then, as closers request leads, send them from cache but update the cache to reflect an “is_acccepted” flag. This way we only call each source as we run out of cached leads so just once as we run out, instead of once per closer requesting a lead?

Then we can use simulated locking with memcached – http://code.google.com/p/memcached/wiki/FAQ#Emulating_locking_with_the_add_command

Does this seem like a viable solution? Any recommendations? We need to minimize the chances of lock waits desperately and quickly.

  • 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-24T04:03:51+00:00Added an answer on May 24, 2026 at 4:03 am

    Sounds viable, but have you looked at your indexes and are you using proper isolation levels on your selects?

    Previous SO question may help with the answer your seeking: Any way to select without causing locking in MySQL?

    If you perform your select/update in a SP with full transaction’s this could also speed things up quite a bit due to optimization. Of course, there are times when SP’s in MySQL are much slower 🙁

    I’d have put this as a comment, but haven’t reached that level yet 🙂

    And I did read the part about inno-db, but experience has shown me improvements even with inno when using isolation levels.

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

Sidebar

Related Questions

I have a big fat query that's written dynamically to integrate some data. Basically
I have an app that saves google map markers, I basically save the lat
I basically have a program that filters records from one excel file to another
I basically have 7 select statements that I need to have the results output
Basically I need to be able to have a few tables for sales of
Basically put, I have an action that saves a form to a database, then
I have an action that basically does this: public ViewResult Save(Foo postedFoo) { Foo
I have one array that contains some settings that looks like basically like this:
I have an Access Form - lets call it Add Labor (Access 2007) that
I have 2 queries that I would like to combine into one. Basically I

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.