[Dbix-class] Index-lookup in where clause.. Indexed stored procedure.

Ash Berlin ash at cpan.org
Tue Jul 11 11:14:20 CEST 2006


Jesper Krogh wrote:
> Hi.. I have a table with elements of the followin form
>
> prefixdigit ... such as:
> abs123
> aasfdasdf91231231
>
> Then I've created to immutable stored procedures in postgresql and created an
> index on them:
>
> The stored procedures take the prefix in lower case and the digit.
>
> Thus.
>
> select element,prefix(element),digit(element)
> gives (on Abs123).
>
> Abs123,abs,123
>
> And using a select from the psql prompt makes Postgresql use the index:
>
> select * from table where prefix(element) = 'abs' and digit(element) > 100;
>
> How do I create this query using DBIx::Class?
>
> Jesper
>   
Unless you have a *VERY* good reason to keep the fields as one, split 
them out into two separate fields.

Ash




More information about the Dbix-class mailing list