[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Wed Apr 28 00:34:51 2004 -->
- <!--x-from-r13: psbjyre ng bhgcbfgfragvary.pbz (Quevf Tbjyre) -->
- <!--x-message-id: 1083126767.18748.179.camel@devel -->
- <!--x-reference: 1083110917.17415.153.camel@devel -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Organizing data -->
- <li><em>date</em>: Wed Apr 28 00:34:51 2004</li>
- <li><em>from</em>: cfowler at outpostsentinel.com (Chris Fowler)</li>
- <li><em>in-reply-to</em>: <<a href="msg01212.html">[email protected]</a>></li>
- <li><em>references</em>: <1083110917.17415.153.camel@devel> <<a href="msg01212.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Organizing data</li>
The tree looks like this
alarm -> location_id -> notification_group_id ->
escalation_id -> user_id
user_id
...
escalation_id -> user_id
user_id
...
alarm -> location_id -> notification_group_id ->
escalation_id -> user_id
user_id
...
escalation_id -> user_id
user_id
...
Then of course it repeats.
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).
On Tue, 2004-04-27 at 22:38, Jason Etheridge wrote:
> Chris Fowler wrote:
> > Would this be the best way to group that data? I'm trying to do it in
> > as few cycles as possible because I have no idea how big that report can
> > get.
>
> So you can't just pull the data out of the database whenever you want?
>
> And when you do, you want to move this data into perl as quickly as
> possible and worry about access speed later?
>
> If using DBI, I'd be tempted to just dump the results into a file with
> something like:
>
> $rows = $sth->dump_results($maxlen, $lsep, $fsep, $fh);
>
> But I don't know how efficient that is, and the man page doesn't
> recommend it for data transfer applications. Hrmph.
>
> fetchrow_arrayref is supposed to be the fastest access method, but you
> can't keep the reference so I don't see what it buys over
> fetchrow_array. If you want to store everything as delimited strings:
>
> while ( @results = $sth->fetchrow_array ) {
> $userid = pop @results;
> $email = pop @results;
> push @{ $user_data{$userid} }, join("|", at results);
> if (! defined $user_email{$userid}) {
> $user_email{$userid} = $email;
> }
> }
>
> Probably faster just to keep pushing arrays rather than concatenate into
> strings.
>
> push @{ $users{$userid} }, @results;
>
> But then retrieval is a little more complicated.
>
> Is this the type of stuff you're looking for? I don't know perl's
> object oriented stuff yet.
>
> -- Jason
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01220" href="msg01220.html">[ale] Organizing data</a></strong>
<ul><li><em>From:</em> phasefx at magusaptus.com (Jason Etheridge)</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>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01212.html">[ale] Organizing data</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01214.html">[ale] Linux on Yahoo Tech Tuesday</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01212.html">[ale] Organizing data</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01220.html">[ale] Organizing data</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01213"><strong>Date</strong></a></li>
<li><a href="threads.html#01213"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>