Closed Bug 401980 Opened 17 years ago Closed 17 years ago

use a simpler query than mDBGetURLPageInfo for IsURIStringVisited

Categories

(Firefox :: Bookmarks & History, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3 beta3

People

(Reporter: moco, Assigned: mak)

Details

(Keywords: perf)

Attachments

(3 files)

use a simpler query than mDBGetURLPageInfo for IsURIStringVisited

all we care about is if visit count is > 0, but our query is:

"SELECT h.id, h.url, h.title, h.rev_host, h.visit_count FROM moz_places h WHERE h.url = ?1"

Why not:

"SELECT h.visit_count FROM moz_places h WHERE h.url = ?1"
maybe with a with tons and tons of links (http://lxr.mozilla.org/seamonkey/source/layout/base/nsCSSFrameConstructor.cpp) fixing this could have a measurable performance impact?
from an sql perspective there is no difference, both queries takes about 0,22ms, the only difference will be in memory consumption due to h.url, h.title and h.rev_host that are (could be) long text fields. 
For this reason a good choice could be use mDBGetPageVisitStats instead of mDBGetURLPageInfo

      "SELECT id, visit_count, typed, hidden "
      "FROM moz_places "
      "WHERE url = ?1"

this will add only typed and hidden that are int, should be memory friendly enough without adding a new statement
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Attachment #293490 - Flags: review?(sspitzer)
Keywords: perf
Comment on attachment 293490 [details] [diff] [review]
use mDBGetPageVisitStats instead of mDBGetURLPageInfo for visit count

r=sspitzer, thanks marco.

if we get approval, I'll land for you.

it sounds like, which this might not show up in Tp, it could affect MH test.
Attachment #293490 - Flags: review?(sspitzer)
Attachment #293490 - Flags: review+
Attachment #293490 - Flags: approval1.9?
Target Milestone: --- → Firefox 3 M11
Attachment #293490 - Flags: approval1.9? → approval1.9+
fixed, thanks again marko.

Checking in nsNavHistory.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v  <--  nsNavHistory.cpp
new revision: 1.215; previous revision: 1.214
done

while we can't test IsURIStringVisited() directly, we can and should test nsNavHistory::IsVisited(), so adding in test suite ?.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite?
Flags: in-litmus-
Resolution: --- → FIXED
> it sounds like, which this might not show up in Tp, it could affect MH test.

it didn't show up anywhere, but I'm still glad we fixed it, thanks marco.

see also bug #408790 which I found while testing your patch.
Attached patch testSplinter Review
note, we do have one test for isVisited() already, see http://lxr.mozilla.org/mozilla/source/docshell/test/unit/test_nsIDownloadHistory.js, but this tests something else.

we really should test isVisited() in places.

note, part of this test will fail because of bug #408790 so it is commented out.

once we fix that bug, we can uncomment (and complete) the test of uris that we block from history.
Attachment #293736 - Flags: review?(dietrich)
Comment on attachment 293736 [details] [diff] [review]
test

r=me, thanks for adding this.

yes, we need to go though and find other areas of the API that also do not have breadth testing like this.
Attachment #293736 - Flags: review?(dietrich) → review+
test checked in, thanks dietrich

once I have a fix for bug #408790, I'll re-enable the commented out parts (and finish testing other schemes which should be blocked from history.)

Checking in test_isvisited.js;
/cvsroot/mozilla/toolkit/components/places/tests/unit/test_isvisited.js,v  <--
test_isvisited.js
initial revision: 1.1
done
Flags: in-testsuite? → in-testsuite+
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".

In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body   contains   places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.

Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.

Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: