PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Query re Sybase::CTlib's ct_sql returning alot of data
Date: Aug 16 2000 4:25PM

tim.wilson@barclayscapital.com writes:
 > I suppose this query is going directly to you Michael but I am interested if
 > anyone else has experience in using ct_sql (or Simple's methods) to return
 > large datasets
 > 
 > In the document 'Sybperl 2.0: Using the Sybase::CTlib module' 
 > 
 > (http://www.mbay.net/~mpeppler/Sybperl/article.html)
 > 
 > Michael Peppler states regarding the use of ct_sql in the section One Step
 > Queries:
 > 
 > "
 > This one step call is very useful for writing simple, clear code, but has
 > one major drawback: the entire query result set is loaded into memory, which
 > makes it unusable for processing large result sets. 
 > "
 > 
 > When you say unusable for large result sets, do you mean there is a problem
 > with either ctlib or Sybase::CTlib when returning large result sets or that
 > this would fail if you ran out of memory during the operation.

Well - if you're doing this:

my $data = $dbh->ct_sql("select * from my_huge_table");

and "my_huge_table" has 100 million rows then your script is going to
crash (unless you run in 64bit mode and have a huge address space...)

There's no internal limitation on ct_sql, or perl, apart from the
available memory.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com