Search
Wednesday, 13th of September 2017, 2:41:35 UTC
2:56:47
Zhivago
It should be able to efficiently index the tags column.
2:57:49
Zhivago
You'd end up with (item-id-1, tag-1), (item-id-1, tag-2), (item-id-2, tag-1), etc, tuples in the table.
2:58:43
Zhivago
Presumably the SQL system should be able to arrange its indexes to efficiently answer queries like "select item-id where tag='tag-1'".
2:59:30
jmercouris
Zhivago: I understand how that works for a single tag, but how could I query for multiple tags?
2:59:47
jmercouris
and shouldn't it be something like "where tag contains 'tag-1'"?
3:00:04
jmercouris
would I have to do multiple queries and a join? sorry for the questions, dbs are not one of my strong suits
3:07:18
pierpa
no, you do one query. The query optimizer of the DB will devise a way to perform the query efficiently
3:08:51
pierpa
the kind of situation you describe is a very typical, and DB handle this very well
3:09:49
pierpa
you only need a good SQL tutorial :)
3:11:26
jmercouris
pierpa: okay, that makes me feel a little better about using sqlite :D thanks!
3:12:08
jmercouris
I guess time to look for a good sql tutorial
3:16:09
jmercouris
pierpa: is any of these the approach you describe? https://stackoverflow.com/questions/2885564/ways-to-implement-tags-pros-and-cons-of-each
3:18:57
jmercouris
pierpa: or did you mean this: https://stackoverflow.com/questions/3498844/sqlite-string-contains-other-string-query?
3:19:28
pierpa
I'm no DB expert, but I'd say way 1 and 3 are dumb, way 2 the only acceptable, but I may be wrong
3:20:12
pierpa
no wait, way 3 is ok too :)
3:21:52
pierpa
let me rephrase: way 3 is good, way 2 less so but is simpler and for small DBs may be viable, way 1 is dumb
3:22:13
jmercouris
I see, so no good indexing + contains?
3:22:24
jmercouris
so none of this:https://stackoverflow.com/questions/3498844/sqlite-string-contains-other-string-query
3:22:49
pierpa
you mean contains as a string, or the set of tags contains a subset of tags?
3:23:07
jmercouris
let me make a paste one sec
3:24:38
jmercouris
https://pastebin.com/ELZL1uUg
3:24:57
pierpa
do you really need to match substrings, or you considered this only as a possible approach?
3:25:31
jmercouris
pierpa: I only considered at as a possible approach
3:25:39
pierpa
you mean you are doing as in way 1
3:25:42
jmercouris
it doesn't strongly matter to me how the data is matched, just that there are tags
3:25:47
jmercouris
and that I can query them
3:26:02
jmercouris
pierpa: as of now, I am not doing it in any way, i haven't started on the implementation yet, just seeking advice before i start
3:26:13
jmercouris
I even thought about using something like unql
3:26:30
jmercouris
I'm not sure how people will want to query their history, by date, by tags? by url?
3:26:34
pierpa
I think storing tags as a comma separated list of names in a string is not a good idea
3:26:44
jmercouris
pierpa: I would agree with that
3:27:25
pierpa
do you understand way 2 and way 3 in the stackoverflow link?
3:28:06
pierpa
anyway, sorry must go to bed. Almost dawn here ;)
3:28:17
jmercouris
I understand them yes :D
3:52:14
beach
Good morning everyone!
3:56:04
beach
listpr: Are you new here? I don't recognize your nick.
3:56:28
listpr
im new and anonymous :)
3:56:55
beach
What brings you to #lisp?
3:57:31
listpr
i just learn lisp in few month
3:58:00
listpr
i want to talk with pro to advandce my skill
5:03:17
manny8888_
** NICK manny8888__
5:04:53
listpr
yes and do you like game in lisp?
5:21:38
beach
listpr: There is a channel for that: #lispgames.
5:21:54
beach
listpr: I don't know how active it is, though, because I am not a participant.
5:26:58
mfiano
actually it is more active than this channel
5:29:33
mfiano
estimated from log file sizes with non-channel-messages stripped, for about a decade of data, that is.
5:31:30
mfiano
It has been a bit less active the last month or 2, but that is expected to pick up again next month when the jam starts. might be a good time to mention if anyone is interested: https://itch.io/jam/lisp-game-jam-2017-hard-mode
6:23:24
Shinmera
hjudt: If you have few pages, make a file per page. If you have lots with little code, make one file that activates the code depending on which page you're on.
Wednesday, 13th of September 2017, 14:41:35 UTC