storing config as "IDs" not names (eg 1 instead of

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
krzys31337
Posts: 65
Joined: Wed Jul 06, 2005 7:43 pm
Location: Poland,Warsaw N 52°09'10" E 20°55'09"

storing config as "IDs" not names (eg 1 instead of

Post by krzys31337 »

Code: Select all

mysql> \s
mysql  Ver 14.7 Distrib 4.1.12, for pld-linux-gnu (i686) using readline 4.3

Uptime:                 12 hours 54 min 10 sec
Threads: 25  Questions: 108941  Slow queries: 0  Opens: 14087  Flush tables: 1  Open tables: 2  Queries per second avg: 2.345
Got silly question: why database storage is somehow not optimized.

look at:

Code: Select all

 select Name,Cause from Events limit 10;
+-----------+------------+
| Name      | Cause      |
+-----------+------------+
| Event-164 | Continuous |
| Event-163 | Continuous |
[...]
| Event-155 | Continuous |
+-----------+------------+
10 rows in set (0.00 sec)
Shouldn't that be just event numer (164 to 155 in above example) and some ID like "2" (2--Continous).

I've got some DB issues and would like cut addtitional overhead on MySQL.

Same with "MoCord" or "Record". One byte should be enough. Or even a few bits (Record yes/no, motiondetect yes/no). When db access will be "superb" and giving as less overhead as possible whole system would benefit.

In Events:

Code: Select all

+--------+---------+---------+--------+---------------------+------------+-------+
| Id     | EventId | FrameId | Type   | TimeStamp           | Delta      | Score |
+--------+---------+---------+--------+---------------------+------------+-------+
| 129256 |     657 |       9 | Normal | 2005-07-14 15:50:54 |      -0.71 |     0 |
| 129255 |     657 |       8 | Normal | 2005-07-14 15:51:03 |       8.08 |     0 |

Changig type to byte will give a lot, even coding as first char 'N-ormal,B-ulk,A-laram...' seems to be ok.

BTW: anyone testet php-accelerators like php-mmturck-cache?
--
Best Regards and sorry for my poor english...
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I don't think DB access is affected by having a few extra fields in the Event table. That is only inserted once per event. Also there is an id field that is a number, the Name is so users can change the event to 'Burglar smashing window etc'. Any field that is used regularly is indexed, and enum fields like Type are stored as integers anyway.

What database issues are you having?

Phil
Locked