[Pdns-users] specifying more complex sql queries with gmysql back-end

Tom tom at t0mb.net
Mon Nov 14 10:56:08 UTC 2011

Hi Peter,

Our setup is a little more complex than the default way of doing 
things.  We have a table which has what we call 'override records', 
which take priority over the records that appear in the normal records 
database.  We also generate SOAs dynamically.  Basically, the query I 
have does a union with records from both overriderecords and records, 
unless the dns is suspended, which is another comparison that needs to 
be done, and it also determines whether the request type is an SOA using 
a case statement, and then executes a stored procedure to generate the 
'content' column data.

I just want to write this in to the config file rather than calling it 
as a stored procedure, and I'm hoping then that I can reduce load of the 
database server by actually having MySQL cache the results of the 
queries (which it doesn't do at all when you call a stored proc).

We also have a custom written MSSQL back-end which at the moment is 
restricting us to using powerdns 2.9.21-2, and I'm looking at trying to 
use OpenDBX for this so I can get on to later versions of powerdns.

Thanks.  Tom.

On 12/11/11 21:03, Peter van Dijk wrote:
> Hello Tom,
> On Nov 11, 2011, at 15:59 , Tom wrote:
>> With reference to specifying the queries I want to use for the gmysql back-end - for instance : gmysql-basic-query=
>> Am I right in thinking that in the pdns configuration file, I'm not going to be able to specify a query with references the name and query type multiple times?  I've just realised that the first time you use %s you're referencing the type, and the second time, the name.  Is there anything I can do to specify more complex queries (which repeat both type and name more than once)?
>> I understand I could be using stored procedures, but due to MySQLs unique implementation, the results of stored procedures are not cached, and nor are the results of queries within the procedures, and that's proving to be a real problem for me!
> I do not have a clear-cut answer for you right away, but I'm curious about what you are trying to accomplish. Could you perhaps share some details about your setup, maybe even show us what the queries you have in mind look like?
> Kind regards,
> Peter van Dijk
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-users

More information about the Pdns-users mailing list