Re: Listen / Notify - what to do when the queue is full
От | Alvaro Herrera |
---|---|
Тема | Re: Listen / Notify - what to do when the queue is full |
Дата | |
Msg-id | 20100208161632.GL4113@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: Listen / Notify - what to do when the queue is full (Joachim Wieland <joe@mcknight.de>) |
Ответы |
Re: Listen / Notify - what to do when the queue is full
|
Список | pgsql-hackers |
Joachim Wieland wrote: > + typedef struct AsyncQueueEntry > + { > + /* > + * this record has the maximal length, but usually we limit it to > + * AsyncQueueEntryEmptySize + strlen(payload). > + */ > + Size length; > + Oid dboid; > + TransactionId xid; > + int32 srcPid; > + char channel[NAMEDATALEN]; > + char payload[NOTIFY_PAYLOAD_MAX_LENGTH]; > + } AsyncQueueEntry; > + #define AsyncQueueEntryEmptySize \ > + (sizeof(AsyncQueueEntry) - NOTIFY_PAYLOAD_MAX_LENGTH + 1) These are the on-disk notifications, right? It seems to me a bit wasteful to store channel name always as NAMEDATALEN bytes. Can we truncate it at its strlen? I realize that this would cause the struct definition to be uglier (you will no longer be able to have both channel and payload pointers, only a char[1] pointer to a data area to which you write both). Typical channel names should be short, so IMHO this is worthwhile. Besides, I think the uglification of code this causes should be fairly contained ... -- Alvaro Herrera http://www.CommandPrompt.com/ PostgreSQL Replication, Consulting, Custom Development, 24x7 support
В списке pgsql-hackers по дате отправления: