Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Your where clause needs to look for values in the non-left joined table, otherwise they'll be nulled out.
  2. fenway

    Very long update

    OK... well, the issue is likely update the index on rank since you're changing it 1.7M times! Do you use this index? Can you live without it during the update? There's a way to disable this.
  3. fenway

    Very long update

    Hmm... I guess you are updating 1.7M rows... best suggestion I have is to set the rank directly in the insert... saves doing the update later/at all!
  4. Sound like a job for printf().
  5. There are some excellent articles in the stickies on performance optimization that discuss covering indexes. Basically, MySQL picks one to use... not at all three.
  6. fenway

    Very long update

    Run the EXPLAIN on the equivalent selects.
  7. fenway

    Very long update

    Missing indexes?
  8. You can't check b.CourseYear and b.StudentID is NULL together... if the latter is null, it's because all b table columns were nulled out... you need to put this condition into the on clause.
  9. Try rewriting this with proper join syntax first.
  10. From a DB perspective, you can have a record with from and until date/time values, one per block of time off. How you want to show this to the user is up to you.
  11. Like I thought... you don't have a 3-column index, you have 3 indexes, each with one column.... that's very different.
  12. NOW() + INTERVAL 1 MONTH saves some parents.
  13. The way to limit the left join is the pull it out into another table with limit 1.
  14. Agreed.... no number should ever appear "twice" in any field.
  15. Not easily... you'll have to recompile the server. Apparently in 5.1 you can roll-your-own parser.
  16. If you're using 5.0, you can query the information_schema table.
  17. @Barand -- no receipt, cash only ;-)
  18. You can simply add a modified column and store NOW() whenever it's changed. There's a TIMESTAMP magic feature too, but I would advise against it.
  19. Could you post your SHOW CREATE TABLE? I think we're talking about different things.
  20. Sorry, I misread the original post. a.anything will never be null in a left join... you need to check the b. table. And don't you want inner join for everything after the import table?
  21. I just bought an engagement ring today!
  22. Why so many left joins? You only need 2 tables and a lot of on conditions.
  23. What's the difference? If you use an inner join, you'll necessarily get one image.
  24. That's quite bad.... that should never happen, because (A) root has access to everything unless the permissions are messed up and (B) you're never supposed to be root.
  25. I've never worked with such things... perhaps someone else can chime in?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.