ACDB  Log In Search
Random
Light/Dark Theme
Site Map
SMASH
or
PASS
books Jul 30, 2011 | Rei
Started work on the Guide Books project.

It's something fun and easy, but led off on a difficult tangent.

This is roughly the 500th time I've created an HTML table. And likely the 300th time I'll write handlers for FORM data. Seems like as good a time as any to analyze all of them, find the similarities, and write a dynamic generation application to cut down on the duplication.

So working on that...


Another memory usage update on the session server.
73375 rei 1 45 1 19112K 15596K accept 3 72:23 0.00% ss

It's nearing 20MB of allocated heap. Wonder when/where it'll hold. 27M to 30M might not be so bad.

I've also been optimizing various MySQL queries, correcting table definitions from back when I was still a Noob. Removing useless indexes, and adding crucial JOIN indexes. Plus completely rewriting some queries so they examine less data and execute more quickly.



mysql> explain SELECT COUNT(*) AS n FROM (SELECT author,COUNT(*) AS n FROM characters GROUP BY author) AS a WHERE n > 10;
+----+-------------+------------+------+---------------+------+---------+------+-------+---------------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+------+---------------+------+---------+------+-------+---------------------------------+
| 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 326 | Using where |
| 2 | DERIVED | characters | ALL | NULL | NULL | NULL | NULL | 25895 | Using temporary; Using filesort |
+----+-------------+------------+------+---------------+------+---------+------+-------+---------------------------------+
2 rows in set (0.02 sec)

mysql> create index author on characters(author);
Query OK, 25895 rows affected (0.80 sec)
Records: 25895 Duplicates: 0 Warnings: 0

mysql> explain SELECT COUNT(*) AS n FROM (SELECT author,COUNT(*) AS n FROM characters GROUP BY author) AS a WHERE n > 10;
+----+-------------+------------+-------+---------------+--------+---------+------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+------------+-------+---------------+--------+---------+------+-------+-------------+
| 1 | PRIMARY | | ALL | NULL | NULL | NULL | NULL | 326 | Using where |
| 2 | DERIVED | characters | index | NULL | author | 4 | NULL | 25895 | Using index |
+----+-------------+------------+-------+---------------+--------+---------+------+-------+-------------+
2 rows in set (0.01 sec)


Go Top

Anime Characters Database Logo Links

Contribute

Who Board | New Thread

12:42 am
Anonymous
Who is this ?

Buy Me a Coffee at ko-fi.com

Increase your fun by becoming a member today! Login | Register

10 fun things to do on ACDB

Advertise - Ko-fi - Share - Mascot - Contact - Discord - API - Wiki - Site Map - Change Log - アニキャラベー - The Nature DB - Twitter - Instagram - Privacy Policy - Rules
All images are copyright of their respective owners. Copyright © Goral Software

Rendered in 85.6 ms. R-7-W-4-M-2994.74 KB