3,474 reputation
1712
bio website mysql.rjweb.org
location California
age
visits member for 3 years, 10 months
seen 3 mins ago
  • Using MySQL for over a decade, starting before version 4.0.

  • Enjoy designing 'huge' databases.

  • Hang out in forums.mysql.com (a lot more traffic there than here).

  • Been programming since before the invention of Unix or SQL.

My documents and tips: http://mysql.rjweb.org/


10m
comment stored procedure not working
What is it supposed to do? I ask because loops in stored procedures often can be replaced by single SQL statements.
1h
comment Optimizing an AVG / GROUP BY query
Bingo. Build a "Summary Table", populate it each day with COUNT(*) and SUM(...). Then build the 'report' from that table, using (sum of sums) / sum of counts) as the overall average. My blog on such
16h
answered InnoDB Table has backed up INSERT and UPDATE queries, high CPU
22h
comment Query that was working on MySQL is not working on PostgreSQL
Show us some values of bin_number.
22h
revised sql query for hierarchal search
more answer
1d
comment sql query for hierarchal search
If each user has 10 sponsors, that would be only 7 queries to find all the sponsors in 10 million rows. Of course, this is an overly simplistic computation; in reality it would probably be between 1 and a few dozen queries to traverse the hierarchy for a given user.
1d
comment I want to rewrite my MySQL query so that FIND_IN_SET doesn't do a full table scan unless necessary
It is quite difficult to read when table2 is used, once with an alias, once without. Please edit the posting to use aliases for both.
1d
comment I want to rewrite my MySQL query so that FIND_IN_SET doesn't do a full table scan unless necessary
Let's see SHOW CREATE TABLE for each of the tables.
1d
answered sql query for hierarchal search
1d
revised sql query for hierarchal search
make table readable
1d
comment combining two different record into single result
The group_by gets rid of the dup rows of output.
1d
comment Guidance in creating a database for parks division attendance data
9*31 rows per month; 30 columns per row (plus some overhead).
2d
answered how many database tables is too much?
2d
answered How to implement a distributed database system
2d
comment Optimize Query in MySQL
3.3 min with my INDEX? How long without? How many rows in the resultset? What is the EXPLAIN with my INDEX?
2d
revised How to merge two databases, both with primary keys
added 115 characters in body
2d
comment Finding the same value in a column and only returning rows without the same value
In many cases a subquery is less efficient. Perhaps it can be done with a subquery.
2d
answered Finding the same value in a column and only returning rows without the same value
2d
comment Finding the same value in a column and only returning rows without the same value
The answer will probably involve a LEFT JOIN, but the definition is too muddled for me to make a stab at it.
2d
comment Finding the same value in a column and only returning rows without the same value
Provide a short set of data, plus the desired output.