Re: Using DBI, better option than importing into @array



Jason <jwcarlton@xxxxxxxxx> wrote:

It's really a simple message board, just with a lot of rows. So the
subjects table is

Categories: id - lastmodified - subject
Actual row: 17090 - 20070730192222 - This is a test

The posts table would be like:

Categories: id - subject - postdate - username - email - comment
Actual row: 17090 - This is a test - 20070730192222 - Jason -
jwcarlton@xxxxxxxxx - This is a test comment.

Where are the messages?

In retrospect, I can't quite remember why I'm duplicating the
information into the subjects table; I think it was at the suggestion
of someone in another NG. I'm sure that the goal was to make the "view
subjects" section load faster by reading 17,000 rows instead of
600,000.

I presume that the goal was to make the subjects load faster by moving
the message _contents_ (i.e., the actual posts) of into their own table.
Anything that you display in the "quick view" should doubtless be
someplace else that allows for faster database access. Granted, a true
SQL VIEW might be able to handle fast selection on a big mess of a
table, but there's no point in doing that.

You need a posts table that contains the post id and the actual content
of the post (oh, maybe that was "comment"?); you need a summary table
that contains the "quick view" content; indices on the primary keys (of
course), and no doubt and index on postdate.

As suggested elsewhere, use LIMIT.

With such a small number of records, the database latency should be far
less than a second.

Also, I'll repeat one other thing from elsewhere, definitely let the
database do the selection because it knows how to optimize for fastest
query return. Looping select statements in perl is generally a bad
idea.

--
Brian Blackmore
blb8 at po dot cwru dot edu
.



Relevant Pages

  • Re: Discerpancy in number of records
    ... "Alan" is trying to subvert the newsgroup to be an advertising vehicle. ... "Alan" posts no useful answers here. ... Whatever you think you are doing, the database to which you posted a link ... a link to an external DBase table... ...
    (comp.databases.ms-access)
  • Re: looking for RealBasic programmer
    ... posts on this newsgroup, you will see what I mean. ... client to REALbasic. ... whilst keeping the database on a remote server. ... language was viewed as learning language and wasn't taken seriously by ...
    (comp.lang.basic.realbasic)
  • Re: Problems because of varying size of fields.
    ... > - and also allowing varying numbers of Words to be entered in the same ... The database consists of text only ... And also a much more time consuming tasak of entering new posts: ... Now I have to find the correct site in the database before entering ...
    (microsoft.public.access.gettingstarted)
  • Re: 2008 Express Edition missing Data drivers?
    ... I think I found the posts I was looking for: ... 2000 instance but the only drivers available are Microsoft Access DataBase ... file, Microsoft Sql Server Compact 3.5, and Microsoft SQL Server Database ... connections in a manner I am familiar with. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cannot install SMS2003 Primary Site with SQL2000sp3a
    ... OK, at Nuclear's request, I cancelled any posts that had the CD key in them. ... Here's a summary of other helpful information in posts that included the ... If so, create the database, re-start the SMS setup process and choose the ... > Check out the SMS Technical FAQ: ...
    (microsoft.public.sms.setup)