Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners Cgi > Re: Perl/DBI
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 6 of 7 Topic 1406 of 1490
Post > Topic >>

Re: Perl/DBI

by tigger@[EMAIL PROTECTED] (Paul Archer) Jun 24, 2007 at 08:53 PM

>> > If you are not interested in using the modules, it is not actually
that
>> hard
>> > to roll your own.  In the past I have done different things for total
>> > counts, either two separate queries, one just a 'SELECT COUNT(*)' and
>> the
>> > other to actually fetch the data.  Depending on your data you might
be
>> able
>> > to add the count into your data fetching query but probably not.
>> >
>> > Why do you not want to use the modules?
>> 
>> Thank you Tyler, I hadn't though about just using select COUNT(*).
>> 
>

> One thing people sometimes do if they have a lot of rows (a whole lot)
is to
> actually keep a separate table that stores the count and then you can
just
> select from that.  It is not recommended unless you really have a lot of
> rows because it de-normalizes the database.  The count() should work
fine
> however.
>

Keep in mind that count() is database dependent, even database-engine 
dependent. For instance, mySQL's MyISAM engine keeps a running count of
the 
number of rows in a table, so count() is cheap. Buy the InnoDB engine does

*not* keep that running total, so count() is relatively expensive. If
you're 
talking a few hundred or thousand rows, it shouldn't be a problem--but if 
you're talking large numbers (six million rows of genomic data, anyone), 
then it'll probably be an issue.

Paul
 




 7 Posts in Topic:
Perl/DBI
shawn@[EMAIL PROTECTED]   2007-06-24 12:31:13 
Re: Perl/DBI
geekout@[EMAIL PROTECTED]  2007-06-24 06:46:16 
Re: Perl/DBI
shawn@[EMAIL PROTECTED]   2007-06-24 13:07:07 
Re: Perl/DBI
geekout@[EMAIL PROTECTED]  2007-06-24 07:36:09 
Re: Perl/DBI
greg@[EMAIL PROTECTED] (  2007-06-24 10:22:09 
Re: Perl/DBI
tigger@[EMAIL PROTECTED]   2007-06-24 20:53:32 
Re: Perl/DBI
dbusby3@[EMAIL PROTECTED]  2007-07-24 10:46:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 11:03:30 CDT 2008.