tsptom
05-14-2010, 04:29 PM
Hi all -
On the homepage of my website (non-VB) I created links to the latest 2 blog entries. The query which finds the latest post does not seem to have a problem, but the query that grabs the second to last post seems to be sluggish.
This one seems OK...
SELECT *
FROM vb_blog
where state = 'visible' and
blogid in (select max(blogid) from vb_blog
where state = 'visible');
This one seems to slow things down...
SELECT *
FROM vb_blog
where state = 'visible' and
blogid in (select max(blogid) -1 from vb_blog
where state = 'visible');
# Query_time: 4 Lock_time: 0 Rows_sent: 1 Rows_examined: 254528
Any suggestions to speed this up?
Thanks!
On the homepage of my website (non-VB) I created links to the latest 2 blog entries. The query which finds the latest post does not seem to have a problem, but the query that grabs the second to last post seems to be sluggish.
This one seems OK...
SELECT *
FROM vb_blog
where state = 'visible' and
blogid in (select max(blogid) from vb_blog
where state = 'visible');
This one seems to slow things down...
SELECT *
FROM vb_blog
where state = 'visible' and
blogid in (select max(blogid) -1 from vb_blog
where state = 'visible');
# Query_time: 4 Lock_time: 0 Rows_sent: 1 Rows_examined: 254528
Any suggestions to speed this up?
Thanks!