Dear All I can use Unlang script and/or Perl module Script to do some select - update or insert in database BUT i need to know witch one is faster Perl module or UnLang ....??? This is important because i have to many stress on database query . I use PostgreSQL by p5-DBI and p5-DBD-Pg . Thanks and Best regards.
On 4 Mar 2013, at 15:56, Mehdi Ravanbakhsh <babakco@gmail.com> wrote:
Dear All
I can use Unlang script and/or Perl module Script to do some select - update or insert in database BUT i need to know witch one is faster Perl module or UnLang ....???
This is important because i have to many stress on database query .
I use PostgreSQL by p5-DBI and p5-DBD-Pg .
Likely unlang if you only want to retrieve one value. -Arran
I need to transfer one radacc Table record to another table (backup radacc) , Transfer means insert in new table and Dell from first one and this is happen every time each user get [ Acct-Status-Type == 'Stop ] . i use perl script to do some calculate and return 3 replay attribute and change 3 check attribute in radcheck table and Unlang just work to execute perl script . so in this case i need to use Perl in general but i can use unlang and Perl to connect and update database by SQL query i need to know that which one is faster and which way has more performance : Perl Directly connecting to PostgreSQL database OR Use Unlang to connect to database by freeradius PGSQL database back-end. and in final i am not understand meaning of " Likely unlang if you only want to retrieve one value." it means that is limitation SQL query in UnLang ? Best reghards. On Tue, Mar 5, 2013 at 12:41 AM, Arran Cudbard-Bell < a.cudbardb@freeradius.org> wrote:
On 4 Mar 2013, at 15:56, Mehdi Ravanbakhsh <babakco@gmail.com> wrote:
Dear All
I can use Unlang script and/or Perl module Script to do some select - update or insert in database BUT i need to know witch one is faster Perl module or UnLang ....???
This is important because i have to many stress on database query .
I use PostgreSQL by p5-DBI and p5-DBD-Pg .
Likely unlang if you only want to retrieve one value.
-Arran - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 4 Mar 2013, at 16:36, Mehdi Ravanbakhsh <babakco@gmail.com> wrote:
I need to transfer one radacc Table record to another table (backup radacc) , Transfer means insert in new table and Dell from first one and this is happen every time each user get [ Acct-Status-Type == 'Stop ] .
i use perl script to do some calculate and return 3 replay attribute and change 3 check attribute in radcheck table and Unlang just work to execute perl script .
Ok.
so in this case i need to use Perl in general but i can use unlang and Perl to connect and update database by SQL query i need to know that which one is faster and which way has more performance :
Perl Directly connecting to PostgreSQL database
Perl as you can select all the values in one query, or the fastest would be to create a stored procedure and call it with unlang, but i'm not that familiar with PgSQL procedures so I can't tell you how to do that.
OR
Use Unlang to connect to database by freeradius PGSQL database back-end.
and in final i am not understand meaning of " Likely unlang if you only want to retrieve one value." it means that is limitation SQL query in UnLang ?
Yes. Unlang/XLAT queries will only assign the value of the first column. update request { Tmp-String-0 = "%{sql:SELECT `a`, `b` FROM `foo` WHERE `bar` = 1;}" } Tmp-String-0 will only hold the value of column a.
Many thanks for your replay. How i can call stored procedure in unlang ? On Tue, Mar 5, 2013 at 1:50 AM, Arran Cudbard-Bell < a.cudbardb@freeradius.org> wrote:
On 4 Mar 2013, at 16:36, Mehdi Ravanbakhsh <babakco@gmail.com> wrote:
I need to transfer one radacc Table record to another table (backup radacc) , Transfer means insert in new table and Dell from first one and this is happen every time each user get [ Acct-Status-Type == 'Stop ] .
i use perl script to do some calculate and return 3 replay attribute and change 3 check attribute in radcheck table and Unlang just work to execute perl script .
Ok.
so in this case i need to use Perl in general but i can use unlang and
Perl to connect and update database by SQL query i need to know that which one is faster and which way has more performance :
Perl Directly connecting to PostgreSQL database
Perl as you can select all the values in one query, or the fastest would be to create a stored procedure and call it with unlang, but i'm not that familiar with PgSQL procedures so I can't tell you how to do that.
OR
Use Unlang to connect to database by freeradius PGSQL database back-end.
and in final i am not understand meaning of " Likely unlang if you
only want to retrieve one value." it means that is limitation SQL query in UnLang ?
Yes. Unlang/XLAT queries will only assign the value of the first column.
update request { Tmp-String-0 = "%{sql:SELECT `a`, `b` FROM `foo` WHERE `bar` = 1;}" }
Tmp-String-0 will only hold the value of column a. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Arran Cudbard-Bell -
Mehdi Ravanbakhsh -
Phil Mayers