Log in

No account? Create an account
linear search - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

linear search [Jun. 26th, 2005|09:07 pm]
Brad Fitzpatrick
[Tags|, , ]

A linear search of my entire journal text isn't too slow with InnoDB. In fact it's pretty damn fast.

Props to InnoDB and how our indexes are setup to cluster all rows based on primary key of form (journalid, jitemid)... so an entire journal is next to each other in the b-trees/disk.

People/things I've mentioned a lot:

whitaker: 134
perl: 176
dina: 210
evan: 234
nick: 308
blythe: 434
eli: 596

(you can tell I use LJ a lot less than during college, eh?)

And <lj user=...> I do a lot:

35 whitaker
30 evan
24 dina
20 nick
14 lisa
12 sherm
8 erik
8 eli
7 jproulx
6 avva
6 calliste
6 mart
6 alanj
6 jwz
5 xb95
5 scsi
5 tigerentchen
5 krow
4 revjim
4 blythe
4 tydel
4 dantes_crew
4 jessicka
4 marcuso
4 patrick
4 toast
3 vanbeast
3 bradfitz
3 brad

[User Picture]From: caladri
2005-06-27 05:02 am (UTC)
You should have <lj user="">'d all of those in the last list.
(Reply) (Thread)
[User Picture]From: caladri
2005-06-27 05:03 am (UTC)
Addendum: and instead of using numbers, just use each the requisite number of times.

Bonus points: count the then-current version of the post against it, etc.

I should really just get drunk, then this will make sense.
(Reply) (Parent) (Thread)
[User Picture]From: dormando
2005-06-27 05:29 am (UTC)
Next to each other when it's been optimized, yeah? I wonder how it handles sequential reads in that case.

...and damn, you linked alanj more than me!? ;) He did write more code, I think. Man, it feels like some people are missing from that list, did you edit it? Must've been non-tags (pre-lj user tag, even?).
(Reply) (Thread)
[User Picture]From: dormando
2005-06-27 05:30 am (UTC)
Wow, that sounds retarded. I kept editing the comment while Lore was showing me a drawing :P
(Reply) (Parent) (Thread)
[User Picture]From: lisa
2005-06-27 05:33 am (UTC)


dina lost out to perl...burn!
(Reply) (Thread)
[User Picture]From: matthew
2005-06-27 06:37 am (UTC)

Re: ooh

oooh, somebody's sleeping on the couch...
(Reply) (Parent) (Thread)
From: jamesd
2005-06-27 06:03 am (UTC)
Makes me wonder whether pulling more old entries from a journal at once, instead of switching to day at a time mode, might be practical. Assuming that too many seeks with MyISAM was the reason for switching.
(Reply) (Thread)
[User Picture]From: brad
2005-06-27 06:52 am (UTC)
What are you talking about? The back-back-back-back links eventually going to day mode? I want it that way --- ?skip=8503 is a terrible URL to have cached and linked, being so unstable.
(Reply) (Parent) (Thread)
From: jamesd
2005-06-27 01:59 pm (UTC)
Yes, that back thing. Not so good for caching but the switch to day at a time mode usually also means switching from worth reading to too much hassle to be worthwhile, usually.
(Reply) (Parent) (Thread)
[User Picture]From: ianiceboy
2005-06-28 07:16 am (UTC)
Agreed. If you're gonna read backwards, it stops being worth it at that point.
(Reply) (Parent) (Thread)
From: jamesd
2005-07-07 04:44 am (UTC)
Brad has a good point about caching though. Should switch to by month or perhaps by week rather than using increasing offsets.
(Reply) (Parent) (Thread)