[Asterisk-Dev] realtime extensions db friendliness

Brian West brian.west at mac.com
Thu Apr 7 17:56:59 MST 2005


Its called paranoia.  It wants to make sure the extension doesn't go 
away while processing is all we can gather.  Its really a flaw if you 
ask me in the switch API.

/b

On Apr 7, 2005, at 6:04 PM, Terry Wilson wrote:

> Is there any reason that the Realtime db switch is so db-unfriendly?
> My extensions table contans extens for just 1,1,Answer and 1,2,Echo.
> Yet, asterisk executes 10 queries for the call.  Here is a log from my
> posgres server for a single call using the realtime switch.
>
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '1'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '1'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '1'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '1'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '1'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '2'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '2'
> LOG:  statement: SELECT * FROM extensions WHERE exten = '1' AND
> context = 'customers' AND priority = '2'
> LOG:  statement: SELECT * FROM extensions WHERE exten = 'h' AND
> context = 'customers' AND priority = '1'
> LOG:  statement: SELECT * FROM extensions WHERE exten LIKE '\\_%' AND
> context = 'customers' AND priority = '1' ORDER BY exten
>
> If you had any extensions with a remotely large number of priorities
> and a couple calls a second it would be definitely impact your db.  2
> calls * 5 priorities * ~4 queries/priority = 40 queries per second...
> as opposed to 2 if you could just grab all of the applicable
> priorities in the beginning.  I didn't want to open a bug if this was
> the intended behavior for some reason.
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list