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

Zbigniew Lukasiak zzbbyy at gmail.com
Tue Jul 11 15:00:11 CEST 2006


Hi,

In my app I have 'cachevect @@ to_tsquery(?)' in my WHERE clause and it
proved to be impossible to have this, with those parents, generated by
Abstract - the only way to have it is by literal.

--
Zbyszek

On 7/11/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
> 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?
>
> Probably using a literal SQL chunk; SQL::Abstract isn't as smart as it
> might
> be about handling functions in the WHERE clause.
>
> --
>       Matt S Trout       Offering custom development, consultancy and
> support
>    Technical Director    contracts for Catalyst, DBIx::Class and BAST.
> Contact
> Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more
> information
>
> + Help us build a better perl ORM:
> http://dbix-class.shadowcatsystems.co.uk/ +
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>



-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060711/2d1ef9c4/attachment.htm 


More information about the Dbix-class mailing list