[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



So your main concern is eliminating data redundancy?  And you don't want 
to just mimic the tables with hashes and arrays?  I'm not sure I'm 
following you right.

> In the database there are many mapping tables.  There is 
> on mapping table that will map a user into an escalation_group.
> There there is a mapping table where we map an escalation_group into
> a larger group called a notification group.  With the mapping tables
> there is no way of knowing how many users are in an escalation_group and
> how many escalation_groups are in a notification_group.  Location_id and
> nottification_group_id is a 1 to 1 relationship.  There is no mapping 
> for them (yet).

escalation_id = escalation_group_id?

Maybe something like:

while ( ($alarm_id,
	$trigger_match,
	$console_id,
	$location_id,
	$notification_group_id,
	$escalation_id,
	$user_id,
	$user_email) = $sth->fetchrow_array ) {

	// FOR LOOKUPS BASED OFF USER
	$user{ $user_id }{ 'email' } = $user_email;
	push @{ $user{ $user_id }{ 'escalation_id' } }, $escalation_id;
	push @{ $user{ $user_id }{ 'notification_group_id' } },
		$notification_group_id;
	push @{ $user{ $user_id }{ 'alarm_id' } }, $alarm_id;

	// etc. for trigger, console, location

	// FOR ESCALATION GROUP LOOKUPS
	push @{ $escalation_group{ $escalation_id } }, $user_id;

	// FOR NOTIFICATION GROUP LOOKUPS
	$notification_group{ $notification_group_id }{ $escalation_id }
		= \@{ $escalation_group{ $escalation_id } };

	// FOR ALARM LOOKUPS
	$alarm{ $alarm_id }{ $notification_group_id }
		= \%{ $notification_group{ $notification_group_id } };

}

That's a syntax nightmare for accessing, though. :-/

I'd keep everything in some sort of SQL database if I could, even if it 
was just a dump of the data accessed through DBI::CSV.

-- Jason


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01221" href="msg01221.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01209" href="msg01209.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="01212" href="msg01212.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</li></ul></li>
<li><strong><a name="01213" href="msg01213.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01219.html">[ale] Any Squidguard for the Impatient on Debian Docs?</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01221.html">[ale] Organizing data</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01213.html">[ale] Organizing data</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01221.html">[ale] Organizing data</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01220"><strong>Date</strong></a></li>
<li><a href="threads.html#01220"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>