Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. fenway

    Slow query

    I see a lot of PHP code -- what I meant was produce an SQL query that will find the most recent one. Then the join will be more obvious.
  2. Well, like I said, this isn't what a database is for. But the bitmask method well work -- why give up/
  3. That's not pretty. I suppose you can treat the entire set of requirements -- binary -- as flags of a bitmask, and then just binary "OR" them together.
  4. Indirectly -- all things being equal, a larger cache will tend to keep more cache records, and assuming a random distribution (never true) of updates and inserts, they would persist longer. But who cares how long they stay? They remain as long as they're valid.
  5. Any is different than all. Please give us a real example.
  6. "all" the columns that match? That's not a job for a database.
  7. Ah yes -- you can't examine any conditions in the WHERE clause for LEFT JOIN'ed table columns -- move them to the ON condition.
  8. fenway

    Slow query

    First, forget about the joins -- write the query that will find the most recent values that you want.
  9. No, that's what you type. Show us the procedure that is stored in the database.
  10. You know, you can submit null, too.
  11. Show us the actual procedure that was created -- as mysql has it stored.
  12. I still don't follow.
  13. LEFT JOIN twice -- see if thath elps.
  14. fenway

    Slow query

    Yes, there is a more efficient way -- first grab the latest row, then join back.
  15. There is no array type column.
  16. fenway

    WHERE if

    Forget the syntax. Describe your use case.
  17. You can use the same expression in your ORDER BY clause, and that row will sort first.
  18. What do you have thus far?
  19. The query cache will persist until something that relates to it is updated -- or a newer entries bumps it out (FIFO).
  20. Yeah, a simple join should do it.
  21. You're going to have to ask us the underlying question, because "time" makes no sense.
  22. It's silly to use it without an index.
  23. Show us the current output, and what you think is wrong.
  24. You don't use GROUP BY to select a specific row -- that's what WHERE clause is for.
  25. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=353570.0
×
×
  • 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.