Re: [sqlite] complex query

2011-02-24 Thread Josh Marell
I would say that couple should be a 3 column table, with coupleID, partner1ID, partner2ID. It looks like right now, you have just coupleID and partnerID, that doubles the number of rows you have. On Thu, Feb 24, 2011 at 7:02 AM, Igor Tandetnik wrote: > Aric Bills

Re: [sqlite] Speed up count(distinct col)

2011-02-07 Thread Josh Marell
I would create a tagList table (integer tagID, string tagName, unique(tagName)) Before performing your batch of inserts, query the tagList table (integer tagID, string tagName), and generate a map (key on tagName, value of tagID). For each tag you want to insert, see if it exists in the map. If

Re: [sqlite] View with values in 1st table replaced by values in second table

2011-01-14 Thread Josh Marell
Thank you both for the advice, I had never thought to join on the same table using 3 different names like that, will have to keep that in mind! On Thu, Jan 13, 2011 at 9:27 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > On Thu, Jan 13, 2011 at 01:44:12PM -0600, Josh Marell scratched on t

[sqlite] View with values in 1st table replaced by values in second table

2011-01-13 Thread Josh Marell
Hi everyone. I am new to this mailing list, so hopefully I will be able to present my idea clearly to you: I have two tables designed as: Schedule { date TEXT UNIQUE NOT NULL problem_set INTEGER literature INTEGER research INTEGER} Presenters { p_id INTEGER PRIMARY KEY short_name TEXT UNIQUE