IRC log for #storm on 20090313

00:00.19*** join/#storm wallflower (n=wallflow@ip-205-246-113-216.pool.grokthis.net)
00:40.01*** join/#storm gord (n=gord@5acacaac.bb.sky.com)
02:26.54thumperjkakar: you around?
02:27.06jkakarthumper: Heya.
02:27.09thumperjkakar: hi
02:27.25thumperjkakar: can you remind me about the default ordering that we get?
02:27.29thumperjkakar: and how to not get it?
02:28.12jkakarthumper: You can specify a default order by defining, on a Storm class, __storm_order__ = (tuple of columns).
02:28.13thumperjkakar: I have some _interesting_ queries being generated
02:28.34jkakarthumper: You can call order_by on the result set to set it to something else.
02:28.43jkakarthumper: Yeah, I figured you guys would run into this with your design.
02:28.48thumperjkakar: how do I set it to nothing
02:29.08thumperjkakar: we have this query right from .branches()
02:29.10jkakarthumper: In Landscape we used to have something similar, but ended up going with functions instead, because we could optimize each query individually, which is hard when you have nodes of builders all lined up.
02:29.24thumperhmm...
02:29.30thumperjkakar: got pointers for us?
02:29.38*** join/#storm shaunm (n=shaunm@c-98-212-133-244.hsd1.il.comcast.net)
02:30.02jkakarthumper: Calling result_set.order_by() looks like it'll work.
02:30.37thumperjkakar: I was thinking of pointers re: our design
02:30.48thumperjkakar: if you guys have been down this road before, and discarded it
02:30.52thumperjkakar: I'd really like to know
02:31.41jkakarthumper: In Landscape we had functions like get_computer(tags=(), distribution=None, ...).  Each one would dynamically build up a where clause, just like your classes do, though not with the cool chaining you have.
02:32.27jkakarthumper: Anyway, we found that in many cases we had to break them out into individual classes like get_computers_with_tags, get_computers_with_distribution, etc. so that we could create the exact query that would perform as best as possible.
02:32.38thumperjkakar: ok
02:32.47thumperjkakar: I think I can bend this to my will
02:32.51thumperjkakar: for our design anyway
02:32.53jkakarthumper: I have a feeling you'll eventually have queries being produced by your collection of where clause builders that will cause you grief.
02:33.11jkakarthumper: Maybe, in those case, you'll be able to do some special casing, or maybe those cases will be rare enough that you can just provide a function.
02:33.13thumperjkakar: possibly, but not just yet
02:33.49jkakarthumper: In any case, I like the elegance of your system.  I'm curious to see how it works in practice.
02:34.06thumperjkakar: it works very well for what it was originally used for
02:34.13thumperjkakar: which was to reduce the set of branches
02:34.22thumperjkakar: however we're now using it to get merge proposals as well
02:34.31thumperjkakar: which have a relationship with branches
02:34.53thumperjkakar: we are using .branches().result_set._select()
02:34.57jkakarthumper: Ah, right.  Yeah, it was join logic (ie: join or do a subselect) that caused us lots of performance grief.
02:35.01thumperjkakar: (we have decorated result set)
02:35.03jkakarthumper: Right.
02:35.15thumperjkakar: but the select has extra tables and ordering I need to kill
02:35.31jkakarthumper: I see.
02:36.00jkakarthumper: That's an annoying problem.  I mean, you can easily set select_expr.order_by to Undef, but it's pretty ugly.
02:36.28thumperjkakar: so, I need to chain another builder without the explicit tables
02:36.50thumperjkakar: then go something like .branches().result_set.order_by()._select()
02:36.56jkakarthumper: Do you need to remove the explicit tables because they cause a performance problem?
02:37.00thumperyes
02:37.04jkakarI see.
02:37.09thumperthey are only joined for the order by
02:37.19jkakarI see.
02:37.26thumperso, kill the order by
02:37.30thumperdon't need the tables
02:37.43thumper...
02:37.48thumperhowever I forsee a problem
02:37.52thumpershudders
02:38.09jkakarWell, I can easily think of ways to mangle the Select expression to do what you want, but I'm trying to think of what the right thing would be.
02:38.13jkakarProblem?
02:41.20thumperone of our tables is a default one
02:41.30thumperand there is the possibility that it is in one of the expressions
02:41.46thumperwill storm barf if it isn't in the store.using(...) ?
02:42.11thumperdoes .using override the table inference engine?
02:45.00jameshif you use store.using(), that needs to specify all the tables used by the query
02:45.47jameshthe sqlobject compatibility layer doesn't use store.using(), instead using AutoTables() -- something that compiles to a truth value but also introduces a set of tables to the query
02:46.27jameshit is a bit of a hack, but it seems like a feature direct users of the Storm API want
02:46.30thumperjamesh: we are using pure storm queries for this
02:48.33jameshthumper: so, store.find(A, AutoTables(B.id == None, LeftJoin(A, B, A.id == B.foo))) would be an example
02:49.33thumperjamesh: interesting
02:49.39thumperAutoTables is in storm?
02:49.49jameshstorm.expr.AutoTables
03:07.20thumperjamesh: I think I'm going to have to come back to autotables
03:07.38thumperjamesh: maybe I'll hit you up for a call some time, and we can go over the branchcollection code
03:07.45jameshsure.
03:19.33thumperhere goes another question
03:20.08thumperif I have something like rs = store.find(Branch, some_expressions) not including Person
03:20.54thumpercan we do something like rs.order_by(AutoTables(Person.name, Join(Branch, Person, Branch.ower == Person.id))) ?
03:23.19thumperjamesh: ??
03:23.51jameshthumper: possibly.
03:23.57thumperheh
03:24.09thumperso.., not sure then?
03:24.28jameshit'll probably work, but I don't know whether we'd want to be held to that ...
03:24.43thumperwhy not?
03:24.46thumperit seems reasonable
03:24.57jameshAutoTables was added as a way to get prejoins working in the sqlobject compatibility layer
03:25.06thumperah,
03:25.35thumpercan tables be added to a result set after it is created?
03:25.42jameshI realise it is a useful feature, but I don't know whether it is the interface we want long term
03:26.22thumperto do this type of orderby?
03:26.29jameshgo ahead and use it to add left/right joins in the where clause, but it'd be good to limit it to cases where there aren't good alternatives
03:27.14thumpermy actual use case is for the order by clause
03:27.30thumperso if we can add tables after the store.find() to do the order by bits
03:27.34thumperthen we have a winner
03:28.26jameshperhaps mail the list saying what you want to do
03:28.36thumperhmm.. ok
03:29.08jameshI'd personally be happier with something like this though: result2 = result1.find(Branch.owner == Person.id); result2.order_by(Person.name)
03:29.19jameshalthough I haven't implemented ResultSet.find() yet :)
03:31.48thumper:)
03:34.35jmloh hello
04:54.19*** join/#storm bigdog (n=scmikes@72-197-8-8-arpa.cust.cinci.current.net)
04:56.37jkakarthumper: I wonder if your branch collection pattern could be augmented with some kind adaptation.  So, whenever a query is about to be run, with all the where parameters, you try to adapt all the parameters to an OptimizedBranchSearch, or something.
04:57.21jkakarthumper: IOW, I wonder if the problems with needing to optimize certain queries could be overcome with some kind of adaptation system to make it possible to optionally provide better queries.
04:58.15jkakarI wonder how heinous the adaptation code would get over time.  I can imagine it getting hairy.
05:08.27jmljkakar: did I show you the version of the module that has visibleByUser return an object of a different class?
05:08.50jml(it does this to optimize queries)
05:38.58*** join/#storm sidnei (n=sidnei@plone/dreamcatcher)
06:12.54*** join/#storm jukart (n=jukart@d91-128-122-97.cust.tele2.at)
06:13.15jkakarjml: Ah, yes, I see what you've done here.  Nice.
06:43.52jmljkakar: thanks.
06:59.44*** join/#storm sidnei (n=sidnei@plone/dreamcatcher)
07:24.46*** join/#storm jukart (i=lovely@81.189.156.94)
11:28.10*** join/#storm bac` (n=bac@cpe-065-190-186-163.nc.res.rr.com)
12:28.15*** join/#storm niemeyer (n=niemeyer@200-138-42-229.ctame705.dsl.brasiltelecom.net.br)
13:33.24*** join/#storm bigdog (n=scmikes@72-197-8-8-arpa.cust.cinci.current.net)
14:34.18*** join/#storm bac` (n=bac@cpe-065-190-186-163.nc.res.rr.com)
14:42.53*** join/#storm deryck (n=deryck@samba/team/deryck)
16:07.17*** join/#storm shaunm (n=shaunm@proxyserver.wolfram.com)
17:05.30*** join/#storm jukart (n=jukart@d91-128-122-97.cust.tele2.at)
17:16.33*** join/#storm jukart_ (n=jukart@d91-128-122-97.cust.tele2.at)
17:54.48*** join/#storm jukart (n=jukart@d91-128-122-97.cust.tele2.at)
17:55.36*** join/#storm MFen (n=cdodt@demo.goonmill.org)
17:55.52MFenare numeric comparison operators in store.find() queries known to work, for postgres tables with schemas?
17:57.20MFeni.e. class Bar(object): __storm_table__ = 'foo.bar' ; xyz = Int()  and store.find(Bar, Bar.xyz > 10)
17:57.29MFenwe're getting no results for that, although Bar.xyz == 10 works
17:57.38MFenand it works in a sqlite table i have here
18:00.24radixit should work
18:01.19MFendo the unit tests run on all database backends?
18:01.35MFen(i'm sure you have one for numeric comparisons)
18:04.13radixyes
18:04.15radixlooks
18:04.56*** join/#storm sidnei_ (n=sidnei@201-66-129-211.cslce701.dsl.brasiltelecom.net.br)
18:05.57radixMFen: are you sure that the field is an int column?
18:06.13MFenyeah, we checked that
18:06.36MFeni'm setting up a minimal test case, i'll report back..
18:06.40radixokie
18:07.25MFenok it's working for me but not him. something's wrong in the code. thanks. :)
18:08.08radixsuccess
19:28.17*** join/#storm sidnei (n=sidnei@plone/dreamcatcher)
22:19.31pyCubeHas anybody done any work on an oracle database backend for storm?
22:19.45pyCubei am fearing we might end up going oracle
22:20.05jkakarpyCube: There's a branch, I think, with work in that direction.  I don't know how far along it is.
22:20.19pyCubeeesh..
22:20.35pyCubei hope i can convince peopel that postgresql would be a better way to go
22:21.07jkakarpyCube: https://bugs.edge.launchpad.net/storm/+bug/127176
22:21.08mupBug #127176: Storm should support Oracle databases <review> <Storm:New> <https://launchpad.net/bugs/127176>
22:21.20jkakarpyCube: https://bugs.edge.launchpad.net/storm/+bug/309382
22:21.21mupBug #309382: add Sequence compilation to oracle-support <Storm:New> <https://launchpad.net/bugs/309382>
22:21.39jkakarpyCube: https://bugs.edge.launchpad.net/storm/+bug/307516
22:21.40mupBug #307516: NamerError due to typo <Storm:New for kov-alfaiati> <https://launchpad.net/bugs/307516>
22:22.03jkakarpyCube: Maybe some combination of the branches there will give you a working Storm on Oracle?
22:23.57pyCubebut ya know.. people feel all safe when they blow wads of cash on stuff that "fortune 500" companies use
22:24.13pyCubeyeah.. i just hope i dont have to worry abuot it...
22:26.26jkakarpyCube: PostgreSQL works pretty well for Canonical.
22:29.07pyCubeyeah.. our biggest issue now is that we have mulitple geographically separate locations.. and we'd really like to have multiple master replaicationiness going on
22:32.18jkakarpyCube: I see.
22:32.38pyCubeit appears that that is a bitch. no matter the backend
22:34.40jkakarHeh
22:40.54pyCubei think we just need to hire a kickass postgresql dba and actually have an employee to maintain things for us, rather than dump a ton of cash at oracle
22:41.00pyCubeit just doesnt 'feel' right
22:41.54pyCubeoh well.. heh
23:01.13jkakarYeah, I would be inclined in that direction.  Smart people can be way more valuable that fancy stuff.
23:24.07MFendoes store have anything like Axiom's upgraders?
23:24.09MFenstorm*
23:24.24MFeni.e. def upgrade1to2(self): ... modify the object to make it a version 2 object ...
23:24.45MFenthis seems like an easy thing to implement myself, but if it happens to be built into storm, why should i?
23:33.06jkakarMFen: No, it doesn't.
23:33.36jkakarMFen: We use a patching system in Landscape (and I think some other internal Canonical projects) that there's been some talk of open sourcing and including with Storm, but no action yet.
23:35.52MFenis that what that's called? a patching system?
23:36.09MFenjkakar: or are you talking about something different
23:39.08*** join/#storm pyCube (n=jmayfiel@12.87.213.242)
23:54.44jkakarMFen: We have a system where we add Python modules called patch1.py, patch2.py, etc.
23:54.59jkakarMFen: A patch table in the database stores the versions that have been applied.
23:55.27jkakarMFen: Whenever we upgrade a database we get all the patches that haven't been applied, and apply them.
23:56.00jkakarMFen: Each patch has an 'apply' method that takes a Store for the database and uses it to make the needed changes.
23:56.02MFenso you patch the entire database
23:56.07jkakarMFen: Yes.
23:56.12MFenit's not per-object somehow. ok
23:56.31jkakarMFen: You could create a policy where you only manipulate one object per patch, but the system doesn't enforce that.
23:56.51MFenthe Axiom system upgrades an object as it loads, when it loads
23:56.53jkakarMFen: In practice, the patches tend to make small changes.
23:57.08MFenso your database can contain mixed versions of objects, but as soon as one finds its way into memory, it is up-to-date
23:57.09jkakarMFen: I see.  That's cool.
23:57.17jkakarMFen: Yeah, nice and lazy. :)
23:57.35jkakarMan, jml is right, we should port Storm to Haskell.
23:57.48pyCubeheh
23:57.54MFenyeah. it's a cool idea. we have an option to do either one, but our database cannot really tolerate a long "down for upgrades" so i'm leaning to per-object
23:58.07jkakarI see.
23:58.43jkakarIt would be cool if storm offered a per-object onload event that you could subscribe updaters to.
23:59.01MFenyes, it would be cool.
23:59.10jkakarMFen: Have you filed a bug about the idea?
23:59.51jkakarMFen: If not, please do.  It would be nice to hear what the perfect API looks like for what you want.
23:59.54MFenno, just started talking about it.  one possible incompatibility with storm is that storm uses your existing tables, and axiom builds them for you

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.