You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@phoenix.apache.org by Cheyenne Forbes <ch...@gmail.com> on 2016/12/06 12:20:43 UTC

Is it efficient to query a VERY huge Phoenix database this way?

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;