<?xml version="1.0"?>
<rss version="2.0"><channel><title>r a d i a n t e n e r g y . o r g</title><link>http://radiantenergy.org</link><description>radiantenergy.org news</description><language>en-us</language><pubDate>25 02 2010 22:47</pubDate><lastBuildDate>25 02 2010 22:47</lastBuildDate><generator>Eric Lundberg</generator><managingEditor>editor@radiantenergy.org</managingEditor><webMaster>webmaster@radiantenergy.org</webMaster><item><title>Cargo Bikes</title><link>http://radiantenergy.org/blog/2009_07_08_Cargo_Bikes.html</link><description>
    I have sort of been considering getting a cargo bike once we move to fairfax, and in the process of looking my buddy pointed me to:
MADSEN Cargo Bikes




Which isn't exactly what I'm looking for (can't imagine getting it up the hill to the house) but it was pretty neat looking.


   More excited about the 2009 Kona Ute.

Of course I'm going to have to ride the hill a few times on the roadbike just to see how feasible it is to even contemplate a cargo bike.

  </description><pubDate>Wed,  8 Jul 2009 11:23:39 PDT </pubDate><guid>http://radiantenergy.org/blog/2009_07_08_Cargo_Bikes.html</guid></item><item><title>Rachel Diaz-Bastin, Nature Illustration</title><link>http://radiantenergy.org/blog/2009_06_26_Rachel_Diaz-Bastin,_Nature_Illustration.html</link><description>Rachel's web site is finally up Rachel Diaz-Bastin, Nature Illustration and she has a few choice
    illustrations up.  Definitely some good stuff.  She is currently taking some Scientific Illustration classes at UCSC which should be good.  Though I
hear they swapped out one of the fancy instructors of the fulltime program for someone else who has been through the class but isn't that great of a 
teacher, definitely a bummer.  Anyway if you need some illustrations you know where to go now. :) 
  </description><pubDate>Fri, 26 Jun 2009 09:43:49 PDT </pubDate><guid>http://radiantenergy.org/blog/2009_06_26_Rachel_Diaz-Bastin,_Nature_Illustration.html</guid></item><item><title>Sequoia National Forest California Academy of Science Beetle Collecting</title><link>http://radiantenergy.org/blog/2009_06_07_Sequoia_National_Forest.html</link><description>
     Over Memorial Day weekend I went camping down in Sequial National Forest with Rachel and two of her co-workers, our goal was to find 4 different types of beetles
that haven't been collected in 30+ years.  Now, to be honest I was expecting some fairly typical car camping - lots of relaxing by the fire and taking naps and wondering around looking at nature.  This was a bit different.  First, we were in the national forest and not the national park.  The national park is world renowned all the big nature lovers tend to go the park, while the national forest is where all the locals go to live it up in the woods.  I realize this is a massive generalization, but in our case the reality lived up to the myth.  We were camped next to a large number of young redneck 'dudes' in the late teenager and up age range.  Playing music, burning things and generally carrying on.  The only decent thing about it was the campgrounds were fairly far apart and in this case there was a small ridge so we didn't actually have to see any of them.  However the first night we were there they were carrying on late into the night.  Car alarm going off for 10+ minutes at 1am, varoius random hoots and hollers, etc.  Luckily they seemed to have burned themselves out that night and were pretty quite the next night.  We eventually found out that as part of the revelry they had chopped down several trees and carved up the picnic table with an axe.  Lovely people, oye!
   
   So apparently the way to go for collecting these beetles is you go to a collection site during the day, poke around for a while turning over rocks and bark and such (an putting them back in the same place after) to see if there are any beetles at all around.  Then you come back after dark with lights and look around the ground for the beetles which are now out and about wondering around.  We did that the first day at our campsite (about 5500' elevation) and found quite a few of one type of beetle Meghan was looking for.  That type of beetle looks identical to one of the others except under the microscope so we might have found 2 of the 4 at this point.
   
   The next day we drove down to town (a 'quaint' place an hour+ away with 1000 people) then up another road to check some other sites.  One was along the river which was was a nice place with great steps down into the river.  Sadly the endless numbers of locals had managed to kind of trash the place, lots of garbage.  We kept going up to another camp about half an hour up into the woods and had lunch.  Walking around after saitiating ourselves we did see a couple of beetles, but also saw a couple of snakes.  Some kind of racer snake and what we think was a Mountain King Snake.  Pretty cool.  We went back to town to get dinner and wait for dark.
   
   Nothing in town was open at all, so we waited in the park next to the police station till five when the bar and nice restraunt in town were going to open.  Super hot, but that was fine sitting in the shade playing cards.  Well it was fine till a fairly crazy woman came over and started talking to us.  Seemed fairly coherent but would just not shut up or take a hint.  She just kept talking and talk, bizarre medical procedures, what was wrong with the local youth, various horror stories from the reservation (she was a good percentage native american) lots of catch phrases that were repeated over and over.  We finally managed to say our goodbyes and leave, and she was still talking as we walked away.  Crazy!  Nice enough but not exactly the peaceful relaxing in the park we were expecting.
     Dinner was OK, the bar had a few quality redneck locals talking it up, the bartender seemed a bit more worldly and relaxed.  The food wasn't super great, the pasta primavera was more like past with thick cream and cheese sauce with a couple veggies tossed in it.  The service was super slow as a huge party showed up after we did and the wait staff was having a hard time keeping up.  There was a couple of people having fancy dinner for prom which was cute.  The best part of the night was either when we told the waitress we were camping in the woods and thought it would be fun to have a nice dinner (at which point she looked at us in horror) or later when we asked for a pen so we could sign the credit card statement and we were told not to steal it.  Good times!
     We made it back to the collection site and poked around for a while, finding a few beetles.  Knowing we had a long drive ahead of us I was talking up the merits of leaving and everyone was getting ready to turn back toward the car when Rachel spotted one of the beetles we needed and hadn't collected yet, excellent timing!  The drive back took ages and various people were feeling car sick by the end of it, but it was great because of all the animals we saw.  In the course of the night we saw a bobcat, three foxes, and various little rodent like things all on the road as we drove back.
  </description><pubDate>Sun,  7 Jun 2009 18:11:45 PDT </pubDate><guid>http://radiantenergy.org/blog/2009_06_07_Sequoia_National_Forest.html</guid></item><item><title>Housing, Real Estate, Oh my</title><link>http://radiantenergy.org/blog/2009_05_16_Housing,_Real_Estate,_Oh_my.html</link><description>So today we bought a house!  Well, given the nature of real estate that might be claiming a little much, but we did accept a counter offer to our offer and in theory 45 days from now on July 1rst we will be able to move in.  The location is lovely, fairly close to downtown fairfax, very quiet, nice view, peaceful.  The house was built in the 60s and is about 1300 sf on a 9200sf downslope lot at the end of road, down a private drive that is shared with the immediate neighbors.  The place seems to be in great shape and has been modernized at some point with double pane windows and insulation and a lovely wood staircase with nice hardwood floors.  It was sold a few years ago and passed all the inspections then so it seems unlikely that there is really much that could go wrong at this point.  Very exciting!  
</description><pubDate>Sat, 16 May 2009 17:55:45 PDT </pubDate><guid>http://radiantenergy.org/blog/2009_05_16_Housing,_Real_Estate,_Oh_my.html</guid></item><item><title>Movie Weekend</title><link>http://radiantenergy.org/blog/2009_03_30_Movie_Weekend.html</link><description>
Rachel and I saw a couple movies over the weekend.  First "I Love you Man" on Saturday over at Larkspur Landing and I can't imagine how it got such good ratings.  It was chuckle worthy a number of times, but mostly it had a lot of awkward humor that didn't seem very plausible and the plot was super predictable.  Sunday night we decided we needed a movie after spending the day looking at houses, so we tested the Roku box's new ability to rent a movie from Amazon.com (which worked really well.)  Continuing the comedy theme we rented "Zack and Miri Make a Porno" which was actually quite funny the whole way through, if not very 'tasteful', and even has some bonus material after the credits.  
  </description><pubDate>Mon, 30 Mar 2009 17:34:51 PDT </pubDate><guid>http://radiantenergy.org/blog/2009_03_30_Movie_Weekend.html</guid></item><item><title>Handbuilding Ceramics Workshop</title><link>http://radiantenergy.org/blog/2009_03_16_Handbuilding_Ceramics_Workshop.html</link><description>
I went to a ceramics workshop this past weekend that focused entirely on handbuilding with slabs of clay.  
The class was taught by Lynn Wood who is also a teacher at Sharon Art Studio where I take ceramics (though not my teacher.)  Anyway she is a professional ceramics person, sells her wares, and is almost exclusively a handbuilder.  I on the other hand never handbuild anything, so I thought it would be a good chance to expand my horizons.   The workshop was good, it had various projects designed to teach different aspects of slab based handbuilding.  Since Lynn was teaching it, there was also a focus on textures which was also nice.  The projects were good in that there was plenty of room for diversity and creative changes to whatever we were working on.  For example the second day we were making three pieces with using a small rectangular template to make a cylinder with 1, 2, and 3+ darts in it.  (A dart being a triangle cut out of an edge, with the two new edges that results in being pulled together and joined.)  The variety of differences between the three pieces each person made was quite something, the differences between the students was quite impressive.  Someone snapped a picture of them all next to each other, and if it surfaces I'll add it to the post.   I ended up making 12 pieces over the course of the 2 days.  Three dishes, two conical mugs (think paper coffee cup) a pitcher, two drop mugs, two little teacups, and a tiny little 'teapot' though more likely used as a soy sauce dispenser.  The workshop was fairly exhausting, and there were several sick folk there so I'm hoping I don't end up sick.  I currently feel fairly terrible but it wasn't a great weekend for on time eating and it's allergy season so I'm hoping it's just that.  It will be exciting to get the pieces back and glaze them when the next session of ceramics starts up again.
 
  </description><pubDate>Mon, 16 Mar 2009 09:40:18 PDT </pubDate><guid>http://radiantenergy.org/blog/2009_03_16_Handbuilding_Ceramics_Workshop.html</guid></item><item><title>Tour of California 2009, Stage 2, Sausalito</title><link>http://radiantenergy.org/blog/2009_02_17_Tour_of_California_2009,_Stage_2,_Sausalito.html</link><description>The Tour of California Stage 2 started in Sausalito, went over the Golden Gate bridge, then started for real and went to Santa Cruz.  Since the start was a few blocks away I got up and wondered down the street to check it out.  Fairly exciting, much larger crowd than I would expect for such an early hour on a holiday in crappy rainy weather.  I saw Lance Armstrong which was cool, hopefully his comeback works out well for him.  All the riders are in such stupendous shape it's pretty crazy to even think about.  Though this time, with the weather, I was happy to go back home. :)</description><pubDate>Tue, 17 Feb 2009 21:10:53 PST </pubDate><guid>http://radiantenergy.org/blog/2009_02_17_Tour_of_California_2009,_Stage_2,_Sausalito.html</guid></item><item><title>Honeymoon photos are up! Belize!</title><link>http://radiantenergy.org/blog/2009_02_15_Honeymoon_photos_are_up!.html</link><description>I finally managed to get around to putting up the honeymoon photos.  I had sorted through them a few months ago, but never quite finished the online process.  Anyway here they are, carefully winnowed down from thousands to under a hundred for each of our three Belize destinations!

2008-10-25 Chan Chich
2008-11-01 San Ignacio
2008-11-05 San Pedro
</description><pubDate>Sun, 15 Feb 2009 17:08:01 PST </pubDate><guid>http://radiantenergy.org/blog/2009_02_15_Honeymoon_photos_are_up!.html</guid></item><item><title>Postgres Partitioning and the Query Planner</title><link>http://radiantenergy.org/blog/2009_02_14_Postgres_Partitioning_and_the_Query_Planner.html</link><description>

	I love that Postgres support partitions, even if they aren't the cleanest to set up and maintain.  However I have run into some issues with regards to the query planner and partitioned tables.  The gist of it is that if the tables are partitioned the query planner can get quite confused and take an endless amount of time to run what should a 'simple' query.  Which isn't in and of itself a problem, query planners notoriously pick less than great query plans.  The problem is that for most cases you can explicitly tell the planner to things 'the right way' (well, your way, anyway) and with partitioned tables you really can't.
I have a key value table organized by group and I have it partitioned by id in order to be able to limit the total number of rows in a particular table (see Postgres Partitioning and hibernate for one way to do that) and my goal is to denormalize this table to use as the basis for a set of datawarehouse tables.  In order to denormalize the key/value table I have to do various subselects against keys that I'm interested in for the datawarehouse.  However the table is partitioned by group_id (a group that the keys belong too, maybe 10 keys per group on average) and the denormalized table will use group_id so searching by key results in large table scans for each subselect of all the child tables.  Ideally there would be a single scan gathering up the data one cares about (ala GROUP SETS) or in my case if there is a UNION of the results of my query on each child table that would work too.  


A simple example shows the issue:




create table FOO (
   id integer primary key,
   group_id integer,
   key varchar(20),
   value varchar(20)
 );

 insert into foo values (1, 1, 'A', 'sdf');
 insert into foo values (2, 1, 'B', 'onv');
 insert into foo values (3, 2, 'A', 'now');
 insert into foo values (14, 2, 'B', 'doe');
 insert into foo values (15, 2, 'C', 'mns');

EXPLAIN
select fooA.group_id, fooA.value, fooB.value FROM
    (select * from foo where key='A') as fooA,
    (select * from foo where key='B') as fooB
WHERE
    fooA.group_id = fooB.group_id


                           QUERY PLAN
-----------------------------------------------------------------
 Hash Join  (cost=16.66..33.31 rows=1 width=120)
   Hash Cond: (public.foo.group_id = public.foo.group_id)
   -&gt;  Seq Scan on foo  (cost=0.00..16.62 rows=3 width=62)
         Filter: ((key)::text = 'A'::text)
   -&gt;  Hash  (cost=16.62..16.62 rows=3 width=62)
         -&gt;  Seq Scan on foo  (cost=0.00..16.62 rows=3 width=62)
               Filter: ((key)::text = 'B'::text)

 group_id | value | value
----------+-------+-------
        1 | sdf   | onv
        2 | now   | doe
(2 rows)


drop table foo;

 create table FOO (
   id integer primary key,
   group_id integer,
   key varchar(20),
   value varchar(20)
 );

CREATE TABLE foo_1 (CHECK ( id &gt;= 0 AND id &lt; 10 ) ) INHERITS (foo);
CREATE TABLE foo_2 (CHECK ( id &gt;= 10 AND id &lt; 20 ) ) INHERITS (foo);


 insert into foo_1 values (1, 1, 'A', 'sdf');
 insert into foo_1 values (2, 1, 'B', 'onv');
 insert into foo_1 values (3, 2, 'A', 'now');
 insert into foo_2 values (14, 2, 'B', 'doe');
 insert into foo_2 values (15, 2, 'C', 'mns');


 EXPLAIN
postgres-dw-# select fooA.group_id, fooA.value, fooB.value FROM
postgres-dw-#     (select * from foo where key='A') as fooA,
postgres-dw-#     (select * from foo where key='B') as fooB
postgres-dw-# WHERE
postgres-dw-#     fooA.group_id = fooB.group_id;
                                 QUERY PLAN
-----------------------------------------------------------------------------
 Hash Join  (cost=49.99..99.99 rows=9 width=120)
   Hash Cond: (public.foo.group_id = public.foo.group_id)
   -&gt;  Append  (cost=0.00..49.88 rows=9 width=62)
         -&gt;  Seq Scan on foo  (cost=0.00..16.62 rows=3 width=62)
               Filter: ((key)::text = 'A'::text)
         -&gt;  Seq Scan on foo_1 foo  (cost=0.00..16.62 rows=3 width=62)
               Filter: ((key)::text = 'A'::text)
         -&gt;  Seq Scan on foo_2 foo  (cost=0.00..16.62 rows=3 width=62)
               Filter: ((key)::text = 'A'::text)
   -&gt;  Hash  (cost=49.88..49.88 rows=9 width=62)
         -&gt;  Append  (cost=0.00..49.88 rows=9 width=62)
               -&gt;  Seq Scan on foo  (cost=0.00..16.62 rows=3 width=62)
                     Filter: ((key)::text = 'B'::text)
               -&gt;  Seq Scan on foo_1 foo  (cost=0.00..16.62 rows=3 width=62)
                     Filter: ((key)::text = 'B'::text)
               -&gt;  Seq Scan on foo_2 foo  (cost=0.00..16.62 rows=3 width=62)
                     Filter: ((key)::text = 'B'::text)



As you can see the partitioned table cost estimate is significantly worse.  As you get more rows and more partitions the difference goes off the charts.  In my real world use case I have 50 tables with a million rows each and 9 keys I'm pulling out, the cost estimate lower bound was a 50 digit number.  Talking to the folks on #postgres irc channel there doesn't seem to be any reasonable way to deal with this, so what
I ended up doing was in my java code running my query on each child individually which was very very fast.  There is talk of GROUP SETS coming in 8.4 or 8.5 which will be nice.

  </description><pubDate>Sat, 14 Feb 2009 18:43:20 PST </pubDate><guid>http://radiantenergy.org/blog/2009_02_14_Postgres_Partitioning_and_the_Query_Planner.html</guid></item></channel></rss>
