SQLite User Forum

ATTACH Documentation
Login

ATTACH Documentation

(1) By Trudge on 2022-10-28 15:46:22 [link] [source]

Was reading about ATTACH at [https://www.sqlite.org/lang_attach.html] and read the following in 3rd paragraph:

"... then the table chosen is the one in the database that was least recently attached."

I'm wondering if 'least' is a typo ('last') or does it mean the db attached first? A bit confusing maybe?

(2) By David Raymond (dvdraymond) on 2022-10-28 16:15:34 in reply to 1 [link] [source]

Basically the schema search order for a bare identifier is temp, then main, then attached databases in order of their attaching.

(3.1) By Chris Locke (chrisjlocke1) on 2022-10-28 21:26:04 edited from 3.0 in reply to 2 [link] [source]

Would that not be 'earliest' then, not 'least'? The more I say it, the more it doesn't seem right. Least recently used usually refers to an item that hasn't been used lately.

Edit: I'd originally put that it should be corrected to 'last', same as Trudge's suggestion but this is wrong, if it does in fact search in the order they were attached.

(4) By Simon Slavin (slavin) on 2022-10-28 20:55:31 in reply to 3.0 [link] [source]

I might say that the wording is poor. Instead of 'least recently attached', perhaps 'attached earliest'.

(5) By Keith Medcalf (kmedcalf) on 2022-10-28 22:29:59 in reply to 4 [link] [source]

Or maybe "attached for the longest time" ... (also known a "least recently")

(6) By Ryan Smith (cuz) on 2022-10-29 11:38:22 in reply to 4 [link] [source]

I'm not sure why this is confusing.

The word "recent" simply means "the near past", and so "most recent" means nearest past, as in if I follow the timeline back through time into the past, I will encounter the "most recent" event first (aka "last" or "latest"), and if I continue further into the past, any more such events I encounter would be "less recent".

Following the example further: "Least recent" would denote an event on the historic timeline that is furthest back, aka "oldest", "earliest" or "first" of its kind.

It's usually clearer when thinking of it in more human terms. Your eldest sibling is the one born "least recently".

I hold that it is not confusing documentation. If the chosen phrase was:

  1. Wrong,
  2. Ambiguous, or
  3. Misleading,

then I would advocate for it being changed, but it is so very explicit and clear, and the only time one can be confused is if either of the words "least" or "recent" were not understood - which can happen when reading tech docs, but is easily remedied by any of the myriad of available language references.

(7) By anonymous on 2022-10-29 18:11:43 in reply to 2 [link] [source]

if this thread is 'is there a better explanation, i think what you have is more clear (at least to me).

to brainstorm a bit further:

...then attached databases sequenced by order of attachment.

i am not a fan or mixing length of time into it as it technically.

example: db 1 attached, db 1 detached, intervening db2 (tm ibm) attached, reattach db 1.

Length of time is confusing because with the above, 'least recently' would be db 1, whereas your wording(or tweaking noted above) renders db 2.

(8) By anonymous on 2022-10-29 18:28:53 in reply to 6 [source]

i have seen a great deal of confusion when a deceased comes back to life.

if a db can be attached, detached, re attached, then the sibling order example does not hold. the first of three brothers dies then comes back to life, is he still the first?

my understanding is the attach search order is more like the order in which the three brothers show up to counted, to use your metaphor.