Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. 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.
  2. 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.
  3. An IN() clause would have saved you a lot of headaches.
  4. You'd have to benchmark it-- a count is usually faster.
  5. If it's just a single sub-category, a single LEFT JOIN should be sufficient.
  6. because the same query is used in many places within the site. That's not a good reason -- do you use connection pooling?
  7. fenway

    MYSQL LIMIT

    Barand just knows everything -- including the power of secret and magic constants.
  8. What does your query output? How deep in your nesting?
  9. 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.
  10. 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.
  11. This sounds like homework -- what are you actually trying to do?
  12. A random row from a file shouldn't be any faster.
  13. fenway

    MYSQL LIMIT

    2^32 - 1 works too -- but I don't think you can use expressions in the LIMIT.
  14. Ok -- so what's wrong with one rand query per table? Not that I understand what's in each one.
  15. You should also avoid posting an entire script when a single sql statement will suffice.
  16. Also, I'm not sure that GROUP BY makes any sense given the columns in your SELECT list.
  17. You want to change a boolean field to "2"?
  18. The real question is what data you're trying to represent that you think will only ever be 1 digit.
  19. 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.