Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. That is very strange... which table type?
  2. How is this different from your initial code?
  3. What are you trying to update that's in both tables? I'm confused.
  4. To represent the same thing? I like keeping the names the same.
  5. Not really -- inexact matches are poor to begin with. Why is your data stored this way?
  6. Echo the sql statement... you sure you're getting the right $id?
  7. Not without a stored procedure.
  8. Post the EXPLAIN... maybe you're missing indexes.
  9. If you'd like, you can combine them into a single "statment", but it would still be running multiple queries... I suppose you'd save the overhead of multiple query() calls. You can do this: ( SELECT COUNT(*) FROM gift_items ) AS gift_items, ...... ( SELECT COUNT(*) FROM collectibles ) AS collectibles FROM DUAL
  10. LIKE is instead of = Only other robust option is Lucene.
  11. There are some stickies on DB normalization... but in general, yes.
  12. Sometime localhost and 127.0.0.1 on windows aren't the same.
  13. You can use wildcards to join 2 tables, it's just not efficient.
  14. Stop right there... you need to be running COUNT(*)s, not getting back all of the data and then throwing it out... your current implemention is likely much slower as a result.
  15. I don't see you ever retrieving the columns from the result set your obtained.
  16. Let's start again... post the code you have now.
  17. That's because the LEFT JOIN makes checking any rows from that table meaningless... when you switched it the checking the non-joined table, it was fine. Separate? please cxplain.
  18. LIKE is just returning true or false.
  19. You can combine multiple conditions in the ON clause like in a WHERE clause.
  20. Well, you can recompile the server to change the minimum length....
  21. Sorry, replace = with IN, my bad.
  22. This is the syntax: GRANT ALL ON mydb.* TO 'someuser'@'somehost'; Not the quoting before and after the @ sign.
  23. The first query is good -- you see how there's no filesort, and the key isn't NULL? The second query is bad for two reasons: first, there's no index on the members (table scan = ALL)... second, you're using a dependent subquery, which si executed once for EVERY matching row of members -- or ~2600 times! Could you explain what you're trying to query? For the 3rd one you still have no index usage -- add an index on friendID for the members_detailed table, and add a composite index for ( theirs, yours ) to added. Also, your queries would really benefit from table aliases and column prefixes.
×
×
  • 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.