mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-07-04 19:11:47 +00:00
Fix/sql query optimize (#233)
* Add STRAIGHT_JOIN to CIDR gateway query to prevent MySQL optimizer from choosing inefficient full table scan on voip_carriers table. * update tests with latest schema * fix test data * security issues * update workflow actions
This commit is contained in:
+1
-1
@@ -42,7 +42,7 @@ AND sg.ipv4 = ?
|
||||
ORDER BY vc.account_sid IS NOT NULL DESC`;
|
||||
|
||||
const sqlSelectCIDRGatewaysForSP =
|
||||
`SELECT sg.sip_gateway_sid, sg.voip_carrier_sid, vc.name, vc.service_provider_sid,
|
||||
`SELECT STRAIGHT_JOIN sg.sip_gateway_sid, sg.voip_carrier_sid, vc.name, vc.service_provider_sid,
|
||||
vc.account_sid, vc.application_sid, sg.inbound, sg.outbound, sg.is_active, sg.ipv4, sg.netmask, sg.pad_crypto,
|
||||
vc.register_username, vc.register_password
|
||||
FROM sip_gateways sg, voip_carriers vc
|
||||
|
||||
Reference in New Issue
Block a user