dreel has asked for the wisdom of the Perl Monks concerning the following question:

Can I make a search directly in resultset object? I/m using windows perl Catalyst DBD::Odbc and MS SQL Server. Dbix preparing query too long and retrieving resultset very slow, that why i want to replace
$c->model('QDB::Networks')->search({},{ })
with search in resultset. Is there an ability to do it?

Replies are listed 'Best First'.
Re: [Dbix-class] search in resultset?
by stonecolddevin (Parson) on Aug 13, 2007 at 08:11 UTC
Re: [Dbix-class] search in resultset?
by CountZero (Bishop) on Aug 13, 2007 at 08:55 UTC
    You will really have to profile where the delay is: in making the connection, preparing the query, returning the query-results or objectifying these results. The speed of preparing the query and returning the query-results are of course network and/or server-determined and there is not much DBIx::Class can do here. Rewriting the query, using indexes, ... are all good techniques for speeding-up the record retrieval.

    If you have a really huge amount of data to retrieve, paged retrieval can be considered, so you don't get all the data in one bunch, but in separate "pages"

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      Thanks for advice!