Ühel kenal päeval, E, 2007-03-26 kell 14:07, kirjutas Tom Lane: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > Why have the name on each message? Presumably names are going to be few > > compared to the total number of messages, so maybe store the names in a > > separate hash table and link them with a numeric identifier. That gives > > you room for a lot more messages. > > That can be done by the application, if its notify payloads are such > that that's a useful optimization. However it seems entirely possible > to me that the payload strings might be nonrepeating and the overhead > of a separate table completely wasted.
What we could do is use one name for many messages/listeners/notifies, so that in case we have 10 backends listening to "ACCOUNTS_CHANGE', then we can keep the ACCOUNTS_CHANGE part only once, and reuse it's id also for LISTENs. That would get the same storage savings as Alvaros proposed hash and only be live during the time whenthere are any listeners. So perhaps it Alvaros proposal can be rephrased thus: "Why have the name on each message? The names are already stored in listen table, just reuse numeric identifier pointing to item in that table. That gives you room for a lot more messages." If there is no name in listen table, it means that nobody is interested and the message can be dropped right away. > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster -- ---------------- Hannu Krosing Database Architect Skype Technologies OÜ Akadeemia tee 21 F, Tallinn, 12618, Estonia Skype me: callto:hkrosing Get Skype for free: http://www.skype.com ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly