I am using sqlite. I have a table called objects and I do a hash check to look for…
Jump to turn (35)
- 1I am using sqlite. I have a table called objects and I do a hash check to look f
- 2Would I be able to create an index on the JSON field? e.g. CREATE INDEX idxobjec
- 3If I have 100k rows in this table, can I create the index after they are inserte
- 4I dropped these indexes but didn't see a change in file size. Is there something
- 5Can I add an auto increment column after a table is already created?
- 6What does a CREATE INDEX IF NOT EXIST query look like? Is is that simple?
- 7If I have an order by with multiple clauses, does it sort them in reverse order?
- 8Is there a way to bitwise OR a column in SQLite? Like if I had an integer field
- 9I have two tables, I would like to select objects that don't have the status CRE
- 10I have two tables, I would like to select objects that don't have the status CRE
- 11If an object had two statuses, one that would invalidate it and another that wou
- 12Please explain how NOT EXISTS works to me in a little more detail. How does sele
- 13Would the LEFT JOIN be more efficient than NOT EXISTS?
- 14I hate fence sitting answers. Pick one.
- 15Is there a way to profile things within sqlite's repl?
- 16My intuition was correct, the left join was orders of magnitude faster. sqlite>
- 17Let's iterate on that query a little bit. I want to select the maximum version o
- 18Could you use a window function here or would that filter incorrectly?
- 19That's nasty, let's go back to the last one. SELECT o.uuid, MAX(o.version) as ma
- 20Given these four tables, our next goal is to get objects with unreviewed events.
- 21Could you redo this one, but caps the table nicknames (e.g. OEL) and keep the co
- 22Last request before bed is for two different queries, one for objects that have
- 23So I have an endpoint for fetching all objects. The above queries was to help wi
- 24I actually like the query parameter approach. I might move the default all endpo
- 25I previously had this function for fetching all objects. It could filter for a s
- 26Sorry to interrupt, I think the UUID parameter should only valid with the all st
- 27For the all objects endpoint I was returning object uuid, and the number of vers
- 28This is what I ended up with - This feels good, the only thing I don't like is t
- 29Working in Flask. I want the following endpoints - @app.get("/datasets/ /objects
- 30If I care a lot about line length, what are some good ways to split this up? @ap
- 31Is this the right way to do an optional parameter? @app.get("/datasets/ /objects
- 32I have a query like - SELECT COUNT() FROM objects WHERE uuid = ? AND version = ?
- 33Since each UUID only has a couple versions, it doesn't seem like a big deal to s
- 34Are primary key auto increment columns indexed by default in sqlite?
- 35When I try to use the regex validation you provided I get the error LookupError:
- User
I am using sqlite. I have a table called objects and I do a hash check to look for duplicate objects.
codeCREATE TABLE IF NOT EXISTS objects ( uuid TEXT NOT NULL, version INTEGER NOT NULL, hash TEXT NOT NULL, object JSON NOT NULL );The hash is in the JSON object field, so I pulled it out into its own column. It's still slowing down at about the same rate. I would like to make an index but I haven't done that yet in any database. Could you explain this to me? Do I need the separate column or can I just use the JSON field?
Before I broke it out, I was querying with this JSON syntax -
codecur.execute("""SELECT uuid, version FROM objects WHERE object->>'$.hash' = ?""", (event.object.hash,)) - Assistant