Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. How are you ordering these records?
  2. I'll have to second that -- IGNORE is just asking for trouble -- drop the constaint, then look at what damage you're about to do.
  3. Are you at all flexible on that? For example, say you are querying a table that has 20 columns and you need to use 17 of them? Would you use "SELECT *" in that case, or would you stick to your guns and actually list out the specific 17 fields you need (i.e. SELECT column1, column2, ... column17)? Just curious, as I'm trying to adopt good/proper habits It's trivial to write a DB wrapper to exclude 3 columns.
  4. An IN() clause would have saved you a lot of headaches.
  5. You'd have to benchmark it-- a count is usually faster.
  6. SQL_CALC_FOUND_ROWS can be insanely slow.
  7. If it's just a single sub-category, a single LEFT JOIN should be sufficient.
  8. I don't know what that means.
  9. because the same query is used in many places within the site. That's not a good reason -- do you use connection pooling?
  10. fenway

    MYSQL LIMIT

    Barand just knows everything -- including the power of secret and magic constants.
  11. What does your query output? How deep in your nesting?
  12. No, there isn't -- SPs don't support dynamic SQL. And they're not supposed to. The whole concept is that the server can optimize the query -- but you've just made that impossible -- and that's why it's not supported.
  13. Why it this an SP to begin with/
  14. Well, you could store the binary data in the database -- but IMHO, it's far easier to simply store a relative pathname and store them using the filesystem.
  15. This sounds like homework -- what are you actually trying to do?
  16. A random row from a file shouldn't be any faster.
  17. fenway

    MYSQL LIMIT

    2^32 - 1 works too -- but I don't think you can use expressions in the LIMIT.
  18. Ok -- so what's wrong with one rand query per table? Not that I understand what's in each one.
  19. How about table structures?
  20. You should also avoid posting an entire script when a single sql statement will suffice.
  21. Also, I'm not sure that GROUP BY makes any sense given the columns in your SELECT list.
  22. You want to change a boolean field to "2"?
  23. In either case, you'd want ENUM.
  24. The real question is what data you're trying to represent that you think will only ever be 1 digit.
  25. Maybe -- do you say local socket only in your my.cnf file, but haven't / can't create it?
×
×
  • 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.