select
count(*)
from pictureinarticle as pa
inner join article as a on a.id=pa.articleid
where a.timestamp between START and END
Thanks! In fact, I've also tried this and the following:
select count(*) from pictureinarticle pa, article a
where pa.articleid=a.id
and
a.timestamp between START...
I have the following 2 tables
table pictureinarticle{
'id' int(10) unsigned NOT NULL auto_increment,
'articleid' int(10) unsigned NOT NULL,
'pictureid' int(10) unsigned NOT NULL,
PRIMARY KEY ('id'),
KEY 'pictureid' ('picutreid', 'articleid')
}
table article{
'id' int(10) unsigned NOT NULL...
Solved finally.
In the while loop (in "new" of "A.pm"), I used regular expression to look for certain patterns. Unfortunately, in "B.pm", "English" module is used and that was included long time ago for test purpose (yes, unfortunately, it is still there, BAD:( and I didn't notice it twice for...
Forgot to mention, in "new" of A.pm, it first opens a file and read all lines into a variable ONCE. Then it has a while loop to iterate all lines to do some processing. It is this while loop that cost that long time.
I have a class moduel A.pm, a non-class module B.pm and a console file C.pl.
This is relationship of these 3:
C.pl "use B;"
B.pm "use A;" and "new A();"
In "new" of A.pm, I have some codes to read a file for about 240000 lines.
But it took extremely long time ( more than 5 minutes!) for A.pm...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.