From: Rafael Kitover Date: Tue, 15 May 2012 12:02:48 +0000 (-0400) Subject: add more docs on software_limit resultset attr X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9c510ba5d0481e77302d8689b4ae5cb63548b200;p=dbsrgits%2FDBIx-Class-Historic.git add more docs on software_limit resultset attr Add a paragraph to Storage/DBI/Sybase/ASE and a section under SEARCHING to Cookbook. --- diff --git a/lib/DBIx/Class/Manual/Cookbook.pod b/lib/DBIx/Class/Manual/Cookbook.pod index 014ff38..c91208c 100644 --- a/lib/DBIx/Class/Manual/Cookbook.pod +++ b/lib/DBIx/Class/Manual/Cookbook.pod @@ -440,6 +440,35 @@ etc.), but this may change in the future. See also L. +=head2 Software Limits + +When your RDBMS does not have a working SQL limit mechanism (e.g. Sybase ASE) +and L is either too slow or does +not work at all, you can try the +L +L attribute, which skips over records to simulate limits +in the Perl layer. + +For example: + + my $paged_rs = $rs->search({}, { + rows => 25, + page => 3, + order_by => [ 'me.last_name' ], + software_limit => 1, + }); + +You can set it as a default for your schema by placing the following in your +C: + + __PACKAGE__->default_resultset_attributes({ software_limit => 1 }); + +B If you are dealing with large resultsets and your L or +ODBC/ADO driver does not have proper cursor support (i.e. it loads the whole +resultset into memory) then this feature will be extremely slow and use huge +amounts of memory at best, and may cause your process to run out of memory and +cause instability on your server at worst, beware! + =head1 JOINS AND PREFETCHING =head2 Using joins and prefetch diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index f7121e1..8d1419f 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -1068,6 +1068,18 @@ for information on changing the setting on the server side. See L to setup date formats for L. +=head1 LIMITED QUERIES + +Because ASE does not have a good way to limit results in SQL that works for all +types of queries, the limit dialect is set to +L. + +Fortunately, ASE and L support cursors properly, so when +L is too slow you can use +the L +L attribute to simulate limited queries by skipping over +records. + =head1 TEXT/IMAGE COLUMNS L compiled with FreeTDS will B allow you to insert or update