phoenix-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cheyenne Forbes <cheyenne.osanu.for...@gmail.com>
Subject Is it efficient to query a VERY huge Phoenix database this way?
Date Tue, 06 Dec 2016 12:20:43 GMT
Is it efficient to query a VERY huge Phoenix database this way?

(THIS IS NOT (YET) A REAL PROGRAMMING LANGUAGE)

chats = phoenix.query(" select id, name from chats where participant1 = ?
or participant2 = ? ", [user_id, user_id]); for_each( chats ) { participants
= phoenix.query(" select p.id, u.name, u.age, p.join_date from participants
join users u on p.id = u.id where chat_id = ? ", this.id); messages =
phoenix.query(" select m.id, m.sender, m.time_date from messages where
chat_id = ? ", this.id); chat = { id: this.id, name: this.name, participants
: participants, messages: messages }; (chat).appendTo(chats_array); };
return chats_array;

Mime
View raw message