Good afternoon, everyone. Welcome to the SAC I'm the executive director of the ESI Department of Energy and Energy Management. As we all know, the ESI has been in a lot of anticipation with regard to the release of the final role in the power of science, which will be published through JOI sometime in the next month. And we are very, very glad that we are joined today by the heads of several very important state-based organizations. As we look at a very important issue in terms of how a 15-color plant is able to address very, very few issues in terms of the whole world and in this very important power sector and the kinds of opportunities as well as challenges at state level as the states look at the kind of possibility that they are given by the proposed fight by governments and issue by the environmental protection agency. So, to start us off today, on our discussion, we will hear first from Jo Goughlin, who is the associate assistant administrator for the climate and the senior council to the assistant administrator for aggregation of EPA and Jo has been in EPA since 2009. He has worked on a whole variety of in the senate working as a majority senior council to the senate environment today and public works in the also served as a legislative director. So, Jo Goughlin has been some kind of experience from kids years in the senate as well as prior work with a variety of NGOs and certainly a very long and active tenure and EPA. So, he is certainly an extremely knowledgeable man because he has been looking for years with regard to his expertise on the climate and issues of the general public. So, Jo Goughlin and Jo members go to all this happened in the last two years plus and put together a power plan and moving forward to the fact that the folks at the EPA chairman's program today will be doing, I feel like saying, all the work going forward because not only a formal matter will the states be in the lead in implementing this program but the three organizations represented will be contributing at least as much creative and insight and leadership to the path of implementation in our plan as they have already contributed in this case development. And I would do my best to pay them and pay their all's patients by keeping my remarks as brief as possible so we can get them to their presentations used to the discussion. I believe that many of you have seen the slides that I am about to go through and really the only purpose of my part of the presentation is to sort of lay the groundwork for a quick discussion on the next panel. What I'd like to cover is at least some of these topics and I think I would start by looking at the key changes we made to the proposal to deal with the final moving power plan and try to focus as much as possible on what the states' options are and ultimately what the power sectors' options are to achieve the environmental results of the program and the lowest possible cost while researching reliability. We've always reminded that many of our slides were rather dense in their composition and that's why this is a good point to remind you all that the slide that I will be using is on our website available for a closer study than you might be able to apply to it now. Changes we made focus in. As you know our first job is to establish a determination of the best system of information production. That's a pattern of the pH job to do a qualitative and quantitative analysis as to what works best to reduce carbon pollution and then translate that into a standard. Moving from proposal to final, we focused exclusively on the generation side if you're actually opposed to what we call building blocks that represent a combination of generation and demand side. At final, we base the standard only on dispatched operational efficiency at both points and greater use of zero. The demand side and the efficiency will no longer part of the mandate as expressed in the U.S. standard is certainly in our view a major option for complying with the standard that either states and public programs or the utilities participating in public programs or using the market for services in and out of themselves. And while we took building block 4 for demand side management out of the mandate we still see it as a prime example of how you can achieve carbon reductions while maximizing cost savings and overall operational efficiency. We pay a lot of attention to the timing of the questions. Now, we express the standard in two tiers. First is the minimum target, the minimum target. The final target being the place on the curve. And the minimum target for understanding a standard that has to be met on average over a multi-year period. At proposal, we defined that multi-year period over the course of 10 years between 2020 and 2019. And our intention was to give states and utilities the significant amount of flexibility in choosing the time at which they achieve emissions reductions over that 10-year period. We got a voluminous, abundant comment to the effect that while everybody appreciated the lip service we gave to allowing states and utilities to choose their own emission reduction trajectory for the life. The way we calculated the standards, the way we generated the state volums, really is a practical matter that did not allow that. At final, we were determined to deliver on and from our own analysis the feedback we got since Office 3rd, when the Administrator signed the rule of the President, melted it. The feedback we got was that this time, not only did utilities have until 2022 as opposed to 2020 to register in gross reductions, but the way we structured the facing-in of the standards for all natural gas plants and therefore the state targets that are derived from those standards will work to provide utilities with the kind of flexibility they have in order to be intended to provide them. One of the things that people noticed about proposal is that we defined the best system of emission reduction and expressed the standard that represented the determination by means of state targets and a great many commenters deserved, but that is not exactly how Clean Air works. Clean Air Award, Clean Air Act in particular section 11, applies to the sources themselves, applies to the indemnors themselves. So, we made a significant shift in how we calculated the application of the U.S.K.R. and we applied it directly to the universe and the new sources. Once we made the determination as to what constituted the U.S.K.R., we then generated the uniformity for all affected coal plants and the uniformity for all energy sources. So that the basis of the U.S.K.R., the standard for which we expressed the U.S.K.R., more closely resembles the way in which we've set standards since the beginning of the industrial implementation of Clean Air. Now we did not discard the state target approach. What we did instead is apply two standards to each state's fleet and generate it as we did a proposal, a state goal. And the state goal is essentially the lynching of allowing states a broad range of options and flexibility for establishing plans and programs to meet the standards. The men in range is from simply applying uniformity to a state's sources to putting in place a variety of energy programs that yield in the end the equivalent of helping a state target. In addition, we expressed each state's target not just as a rating bill, so it was a mass goal, so that states had the option of using some form of emissions allowance trading in addition to the option of allowing. In going back to the shift from expressing the obligation not as state goals in the first instance, but as emissions rates for coal plants and emissions rates for gas plants, one of the things that emerged from the comment record is that the best system of emission reduction, as we define it, including measures like dispatch and increased use of renewable energy, needed to capture the way the utility system actually works, which is not a state by state system, but a system that operates over a broad range of states. And so the way in which we calculated how much and how fast to apply renewable energy, how much and how fast to apply increased dispatch and energy to succeed, was calculated on a grid line basis, not on a state by state basis. As a result of this combination of elements, we think we did a lot to promote the option or promote a range of options that we were asked to promote by good many states that added in particular financial utilities in ways that would really facilitate their adopting compliance strategies to maximize flexibility, including the use of emission rate or emission gas trade. We had proposed that state plans be submitted under a three-year schedule, a one-year schedule for states that didn't need an extension, a two-year schedule for standard law state plans that didn't need an extension, a three-year schedule for state plans that involved state strategies. And we became persuaded, again, by the couple of comments and comments from the record, that really being true to the on-the-ground reality of state administrative law, which often includes participation by state legislatures, we really needed to accommodate a three-year state plan. While some states, we expect, will submit complete plans about September 2016, other states have the option of submitting September 2016, but we'll call an initial submittal that essentially establishes two things. One, a reasonable basis for an extension in the West, and two, some markers of progress that they've started the process of putting their plans together. And finally, we opened up the set of approaches that were available for states that were in the public. What we contemplated with proposal was only one mechanism that would be upfront interstate agreements. What we devised, in fact, is some very good suggestions from some of the folks at the table from other groups, is that we built in a kind of training plan here. So we described the forms of state plans that would have the effect of allowing sources covered by those plans to use credits for allowances from other states that themselves have adopted. This slide is a way of illustrating the way in which we set the coal rate and the gas rate and then apply those two rates. So then again, we have rate goals and mass goals for each state that they are now, it's the primary expression of the DSR standard. They're derived from establishing that standard. The folks in the role of this journey with us are in doubt as to what we call the global law approach. And these were really the three, we're now working forward now with three building blocks that we used to capture what we saw as the best system in the commission. Now it can't be emphasized enough because of the way section 111 works and because of extensive efforts in engagement and outreach. In many ways, what we defined as the DSR is a mirror of what occurred from states and utilities in terms of what they are already doing either by design or as a collateral effect in adopting measures and policies that have the result of producing significant. So the DSR really is, as much as anything else, a record of what we were told states already have experience with utilities or to have experience with in terms of what works to produce carbon pollution and what we're seeing in great many other animals both inside and outside the government are seeing as the prevailing trends don't go into the future. In many ways, it's the market for the existing utilities, strategies, for the existing state policies that are driving DSR. That's why the focus is on enhancing the operational efficiency of carbon power plants, increasing the dispatch of existing natural gas and bi-cycle plants, and increasingly the use of renewable energy. That's what we've defined as the best way to produce carbon pollution. We're moving to this clean power plant timeline taking account of both the state planning process and ultimately the utility implementation process sums that up in 15 meters. We expect to see similes of the year from now from the states laying on the basis of their need for an extension and their sort of down payment in terms of actions that they've been able to muster in the first year. September 2018 is when clients are due. On January 1st of 2022 is when the clients are due to begin. But again, compliance is ultimately defined as an emission reduction tool or an emission reduction rate that met one average over the 2022-2029 period. So many people have observed and we are not arguing on this observation that if states with utilities want to resort to a certain amount of backbone that were compliance, the weight and structure of the inherent argument of this action. We see that as not an inevitable outcome but certainly an outcome to the instrumental to ensuring reliability and ensuring that innovative technologies have no time to develop including a tenant infrastructure instance such as transmission, building on the brakes, fuel economy, increased use of fuel. I think I'm about to reach the point of excessive leadingness and probably will lead to Bill who's members of the crosshairs in figuring out what type of plan they want to submit. And you don't think that chart is to be witness to this one. This folks is white choice books and what we try to do is being correctly responsive to what we were told states wanted to be able to think about is to be delineated in at least six different ways that states can structure their in lines ranging from rather straightforward cap and trade or emission rate trading systems to systems that put together a combination of requirements that apply directly to the power plants and complementary measures of policies that has let's say an ensemble of activities resulting in the state vote. And what we are looking at from the EPA's perspective is a very robust engagement with the states and state vote in the implementation of the state's work in sitting through these options and coming to a conclusion as to which ones were the best for states. Let me perhaps share what I think is one of the more salient pieces of feedback the EPA has gotten from the utility industry. The utility industry has generally been cordial in terms of engaging with us since the end of the war came not to say that they are supportive of that certainly not the boards in the panel certainly not anticipating that they will not engage in vigorous litigation but at the same time what we are seeing in the industry spending a lot of time interacting with us and focusing on their options and one of the things they have asked us to do for states is to start to coalesce around one or two basic approaches that can be applied and throw out the jingle in your nation-wide basis so the day that a power plant operators can be operating in a close to uniform environment with a normal and stable price in terms of what it means for us. So one of the things that we will be supporting not meaning but supporting to the extent that it's appropriate for us to do so is dialogues between utilities and state decision makers in order to perhaps promote it. I will stick past that I will go to noting one other major component of the August 3rd signature package in addition to finalizing the clean power plant which in the form of the final rule defines the state's obligations as triggered by our finalizing the BSER determination and set the standards we propose the federal plan. The act specifies that the EPA has authority to apply the federal plan to power plants operating in states that do not submit approvable state plans to propose federal plan purposes on a couple of different mechanisms in particular rate based training mechanism and mass based training mechanism. It doesn't reopen questions as to what counts best account for the clients doesn't reopen questions for us because they are embedded in those from the proposed federal plan There are two draft model rules that states need to use informally as guidelines or as examples for crafting their own plans or formally states will have the option this is what we propose states will have the option of simply incorporating the model one or the other model rule to choose to define one or the other model rule and the model rules are near images of the two options that we propose for the federal plan mass based training and training. We included one significant voluntary program within the plan out until we call it the energy incentive program it's a what we think is a pretty massive state federal matching fund program but in this case the currency is not dollars it's emissions credits for appliances the CDIP has targeted projects that begin in the next couple of years and reduce either energy savings or emissions reductions or 20 megawatt hours in 2020-2021 specifically from wind and solar or the end-use energy efficiency products that benefit low income communities while as a final matter we've defined eligible projects with respect to time generation accounts we've set a $300 million time bank of minted federal credits to be used to match state credits but we've left open a number of different patient questions like for example what it means to benefit a low income community having a final some of the final points of the project to follow how they have to demonstrate to our public and with respect to those implementation questions we will be conducting a follow on the public process and probably issue some of the other guidance for the public we also pay a lot of attention in the final rule can we direct states to respond in kind in their state plan processes to ensure that the concerns of the environment and justice communities and other vulnerable communities and stakeholders are taken out of both in terms of the state plan process and the analytics supporting both state plans and their submitted implementation of state plans to support the project and I actually think that you heard it it's time to return and I'll go over to Jean-Marie Cosworth and then we can we'll be going forward to the plan and we will ask everybody to hold their questions until we hear from the rest of our panel so I'm sure that you do have a lot of things that you want to talk about but we are now going to turn to Bill Packer who is executive director of NACA very fondly known as the National Association of Native American Agencies and Bill is the founding director of NACA which is comprised of an association state and local air pollution control agency and comes in 43 states the District of Columbia is one of the polluting areas across the country as well as foreign territories and it's NACA's numbers that have the primary responsibility for implementing our country's air pollution control programs and so that means the primary responsibility for implementing this lean power plan and so one of the things in terms of the very important role that Bill and his association are playing to really try and help their membership better understand and find ways to deal with the flexibility of the decision points within the plan at the same time actually has also been working closely with sister associations in terms of NACA and the leader of the terms of the community to look at regulators who also deal with utilities and energy policy at a state and national level so that together the data are really trying to both get help in Canada the best meet the needs of their respective states and do so learning from each other so that there can be as much cooperation and peer-to-peer learning and assistance and we want to welcome this Thank you Carol for a very nice invitation and to your staff for inviting me to represent the state and local air pollution control agencies around the country so I'm going to spend a few minutes following up on the excellent presentation that Joe Dopp had made that he set the table for what is ahead for the states but before I do anything I want to talk about I want to describe a little more who we are what some of the general reactions are to the Clean Power Plan and I'm going to try to give you a general sense of where states are coming from all states are different and you'll find that when I speak about their general view how we're working with stakeholders I'm going to make some comparisons of the state targets to show you how they differ and how some of the state targets have differed from the proposed rule to the final rule describe a few of the state choices I have a similar slide that Joe presented on that very complicated arrest of options but it's important that you see it maybe five times today it'll sink in and then I want to end with discussing the consequences of standing down and saying no, deciding not to engage it so let's begin we're an association of almost every not quite state and local air pollution control agency our members are responsible under page one of the Clean Iraq given the primary responsibility of implementing the rules and regulations and as part of that we are responsible working with the state environmental commissioners in developing plans that meet EPA's regulations I will share with you some general observations about what we like about the Clean Power Plan and some places where perhaps some states feel it's going to be a number of challenges first we're very pleased even during the proposal that EPA provided a good 15 years to meet the ultimate targets this should be sufficient time for electric generating units and states to implement their programs to meet the final obligations we were concerned initially that EPA on top of the 2030 deadline the 15 years took it away in part in the proposal by establishing an interim timeline that has been referred to as the clip beginning in 2020 and many stakeholders not just states felt that require too much too soon and would set us up for failure and I think to EPA's credit they listened to the initial phase of the interim compliance time frame pathway to start in 2022 and that's going to be very public EPA heard loud and clear that the timeline for states submitting claims not just for those that are asking for additional time for a multi-year plan but just generally states who are establishing a single state plan needed more than just the one year or perhaps two years and so EPA for everyone has said let's get three years for compliance there's a quick quote coming in with the first year plan but this is going to be very helpful to overcome some of the initial problems that we face this wasn't so much our issue at the reliability safety valve as a utility industry's issue it did affect what's going on in the states and we don't think it's going to be used much but having a safety valve in the role is helpful and I think gives everyone an ability to sleep easier to know that if things do go awry then there is a way to address those problems and finally and the next slide will demonstrate this perhaps not for everyone so I don't want to paint too wide a brush but EPA made some very important changes to the targets to make the targets for many of the states more equitable and this is a this is a graph that one of my colleagues in my office put together that shows in the blue the wider range of proposed goals but in the red they are narrow considerably so the difference between the most significant target and the least significant target has been narrow considerably in the final role that it was in the proposal and Joe had mentioned some of those reasons it has to do with in essence EPA taking a very conservative view of applying the same condition limit for coal-fired gas-fired and dependent on the mix of fuels in the state apply those accordingly and the gap has been narrow considerably and here is another way of looking at the data this shows the differences between the proposed goals state by state you can actually identify the states you can derive this information and you look at the role of data in EPA's role I'm not sure how the graph got to it but it showed the first 10 or 12 states show how obligations have gotten a bit more stricter compared to the proposal and the last 30 issues states show how the final targets have gotten less stricter and if you look at this just along what the data shows you could argue that many of the states everything else being equal are doing better under a final role than under the proposed targets with everything else being equal that's a simplistic conclusion but this shows how things have changed from a proposed apply I don't want to leave the impression that everything was hunky-dory amongst the states there are still some lingering concerns and in some states they are legitimate and they're going to have to work a bit harder to get through these for example the deadline, even giving three years total for submitting a plan is going to be challenging for some especially where legislatures only meet every other year or only meet a few months during the year so this is a complicated role and it's going to take some extra work to have to adopt special authority to give them the tools to respond unlike proposal states are not giving credit for earlier actions to the state has taken other ways of trying to address that including the program that Joe mentioned in the clean set of energy program but nonetheless actions that were taken several years ago were not necessarily going to be credited as the states that vote initially some state targets are going to be difficult not everybody did better under the final rule and even if they did for some targets it's going to be a new challenge for them most of the states haven't developed compliance plans they don't have programs for reducing greenhouse gases and it's going to take a new and expansive effort not only within the agency but working with other stakeholders who are impacted unlike most clean air programs I mentioned the clean power plan remains complex it's 1500 pages I think just to get through it and states are really trying to get through it I know very few people other than my office who has read the entire document they did and finally for those of you that are working for a congressman or senator this last one is important and please forgive me for sounding a bit broken but this program is not going to be implemented by itself it requires resources and clean energy provides state and local air pollution controlling with money it's not going to be implemented by congress to run programs this is a brand new program the president requested $25,000 to help states implement this program and the congress over the past couple of years has taken the entire amount out and if it doesn't go through this year or even next year then we can be having to implement this very very difficult program without any new money and that's problematic ok so we are working really well with stakeholders and in a I think important way this started at the proposed state when EPA came out with its proposed rulemaking for the clean power plan states unlike any time I've ever seen in my over 40 years in Washington DC began sitting down not only with the normal folks that they deal with on a day-to-day basis states reached out to other entities that have heritage board not been involved in policy development on clean air issues including state energy officials and state utility regulators we will hear from in a second and this was really important because most of the compliance options that will occur with the result of this program will necessitate a close relationship with these energy officials and utility officials and those relationships are carried through in the final rule we already see not even two months after the promulgation of the final rule that a number of states I've just listed a few have already begun stakeholder processes sitting down with utilities sitting down with other stakeholders including states regulatory agencies within their state and try to figure out the best route to take and what they should be pursuing what they should be avoiding I think that's very important there are a number of public meetings that are scheduled in the future I bet everybody in this room has either been to one of these stakeholders processes or if they call their state regulator that person could point to a number of ongoing actions this is all very good sharing of information reaching out and making sure that we understand fully what the repercussions are going to be from any potential compliance strategy that we engage in and I do want to put an explanation point from this last item we've worked really well with Nazio and Naver over the past few years I'll tell you a quick story a few years ago and this is not embellishment we would be at meetings and the state environmental energy and utility commissioner from the same state hardly knew each other either were never introduced certainly never went to the same meeting and imagine them having to work together on a common role or a common strategy and over the past several years we've tried hard to bring these groups together we all have different missions but we want to do the right thing and that has really helped address some of the very daunting challenges that our respective groups face and I keep saying this is really a scientific government that we're trying to work together to make sure we're not stepping on each other's toes and that we're trying to adopt strategies that actually mesh together and reach the most cost effective solution and I think it's working so let me give you a snapshot of where I and others think states are at this very early stage in meeting their interim standards and their final standards the first point is information that can be derived from the role and it's in shark form and it's very interesting it says that nine states have budgets in 2012 that are higher that have more pollution more greenhouse gases than the 2030 target in other words theoretically they don't have to do anything more to retain the 2030 target it may not work that way in practice for a number of reasons but their goal their pathway is going to be pretty easy compared to some other agencies so that's kind of good news for them there are a number of other states this is not our analysis this is one from I think this was a union of concerned scientists report but I would predict with certainty that there will be other analyses coming out in the weeks ahead that will reaffirm this similar conclusion and that is there are probably over half the states in this case 30 states that are well on their way that in this case meeting over half of their obligation for the 2022 interim requirement and about half the states are close to half 20 states are half way toward meeting today their 2030 and why is that? Well this is because of existing strategies primarily in the Clean Air Act but elsewhere ranging from already announced retirement full part of power plants to the incremental progress we'll make on renewable portfolio standards to energy efficiency resource standards and the like so states are well on their way toward meeting both the interim 2022 compliance interim strategy as well as the 2030 targets and again a lot more work needs to be done by a bunch of states and there are a number of tools that will help them and I'll just put in a plug for something that's on our website that we just published in the last month or two and this is a menu of options that will help any stakeholder who's interested in identifying every conceivable control strategy or program that could be adopted in reducing greenhouse gases whether it's the Clean Power Plan or mayors or congressmen's or governor's desire to reduce greenhouse gases this will identify anything you could possibly think of and also talk about the cost, the cost effectiveness the potential greenhouse gas reductions collateral nine greenhouse gas air quality benefits and where that strategy has been employed if you go to our website forcleanair.org you can get a copy yourself not found but at least it's in this area here is a so at the last at the first point here I mentioned the nine states have already pretty much done it their 2030 budget is actually lower than their current 2012 emissions budget here is a graph that shows you those states and the first nine states are pretty much there again this is in very practice and maybe differently depend upon future growth and other factors but you can see kind of a relative relationship of where states are with regard to the 2012 emissions now the one that really looks steep and scary when the time is texas and you would think oh my gosh look what they have to do and I had the same reaction until I learned that their obligation I'm not pooping this but their obligation is 21% they're kind of right in the middle of the pack with regard to the amount of reductions on a percentage basis that they have to make visa be their total inventory so they have a lot of emissions and that's why this looks large but you know the first nine or so are the ones that have not much more to do in theory Joe did a really nice job of keying up mistake choices and some of the compliance pathways that we'll be engaging in and these are going to be complicated choices and they're not they're not all they're not all consistent with one another you know we're going to be of course looking at lowest cost options we're going to be examining we're going to try to do things as simply as possible but sometimes the things that appear simple are not and the ones that are more complicated work out better in the end it's very important for the states and it's almost without exception to preserve state autonomy we do not want EPA to have federal enforceability over some of our programs especially programs like energy efficiency that have already been employed and if anyone's in California they know what I'm talking about they're economy wide greenhouse gas program they have a lot of energy efficiency programs and they're having you know forcing this themselves and don't need interference and the EPA's credit they're not looking to do that but it's an issue that's very sensitive to the states and we will want to talk with other states and possibly engage in either formal or informal interstate strategies that will really help those states meet their obligations this is the exact slide that Joe showed you and I will make three comments about this just to show you the kinds of choices that states are making the first is the first choice a state will make is should they go to a rain phase program pounds per million BTU so there's really no cap emissions it's based upon the rate of generation of a widget or should they go to a mass phase program which is pounds per megawatt so it sets a cap on the amount of emissions that can be spewed and that is that literally is the first choice that a state is going to make and it has a number of repercussions with regard to the strangeness of the program and which path where to choose this chart that you put together was very helpful kind of gives you an idea of what's involved the next point I'll make about it is after you decide whether it's a rate phase program or a mass phase program there are a number of different options within each and if you look at a rate phase program the pounds per million BTU if you wanted to adopt say an energy efficiency program there are some criteria that are extremely important that maybe David were getting to in a second that requires regulators to make sure that the energy efficiency gains are indeed credible and there is something called E-M and V, evaluation, measurement, verification you know trust but verify you want to make sure that what you're getting is indeed accurate and important to account and in a rate-based that's not an easy program, there are some protocols out there but that's something that the states will need to include in their compliance strategies if they want to use energy efficiency and the third thing I'll make is whether it's rate-based or mass-based if one pursues EPA's model rule there are as Joe mentioned there are trading ready programs that allow the state to pursue that approach and not have to reinvent the wheel with regard to the trading of allowances and the credits and the ability to be more flexible in implementation almost done, we on top of what EPA is doing we in NACA are developing our own model state plan it is it probably would be similar but a bit more expansive than EPA's model the purpose is to have a state-generated product with regulatory language and preamble language that can be used by states literally in total or pieces in the development of their strategies we are anxious for states to meet their obligations on time and we're trying to do everything we can whether it's a menu or a model to help them so that they don't they're not faced with sanctions or other penalties for not meeting these obligations and we hope to have this out by the end of this calendar year finally I promised I would say a word about the consequences of saying no so there are many in Congress there are some states and there are others who think it's better to stand down to say no and to fight the implementation of this program and I can only tell you that from our experience there is nothing to gain from doing that and here's why let's let's if a state wanted a federal plan the state has to realize or if someone else went to the federal plan it's by definition going to be less flexible than the state program and by being less flexible it would be more costly it would be less cost effective it would not avail the state of the flexibilities in the clean clean energy incentive program that Jay mentioned and from what we've heard from the utilities who are directly affected by a federal plan they don't want it they would prefer having the states develop the plan than having a federally imposed plan that restricts their flexibility and one other point if I'm a state anxious to have a federal plan it still doesn't make sense because what I could do is take a look at the federal plan see how it addresses my concerns and then take the best pieces of the federal plan and augment it with some other state strategies that might make that federal plan even more palatable to the state there is nothing to be gained by implementing or being subject to a federal plan other than calling attention to oneself and given the importance of this program I don't think that's really a good alternative so with that I'll conclude and say the EPA's credit they did engage in an unprecedented level of state court involvement and I think the final rule is not perfect and while it does have some concerns and it is going to be challenging they listened in large part we hope that no states will reject a federal plan and work with their stakeholders in implementing this program but what we can tell people are working very very quickly and responsibly in starting that process and there are plenty of tools not just ours to help states so with that I say thank you thanks so much Bill and I do want to mention that Jerry's and Bill's slides will be available on EESI's website probably by the end of the afternoon and so I know that these have been very very difficult to see but that will give you a chance to really look at them in much more detail so we're not going to turn to David Terry who is Executive Director the National Association of State Energy Officials, NASIAL and David has been with NASIAL for about 15 years and has ably led that organization in all sorts of matters in terms of working with state energy offices that are located in 56 states and territory energy offices across the country NASIAL and I should say state energy offices are involved with a wide range of energy and energy policy issues that we often probably don't realize and so it's important to understand the huge amount of responsibility that they have and therefore hopefully the whole world that they can play as Bill was saying in terms of working with the air regulators and certainly with the utilities in their states since they work on a whole variety of national energy issues including natural gas and electricity buildings energy efficiency renewable energy policies industrial energy efficiency as well as working in the whole area and being responsible for energy emergency response and reliability very very critical issues as we know so David Thanks Caroline, thanks for your time this afternoon just following up on some remarks that Bill made I think the collaboration between organizations and more importantly our organization's membership has been remarkable it's made things I think go as well as they have the input we were able to provide to EPA I think in the formation of the will was certainly helped by that collaboration a couple of things to give you a sense of the lens that our members bring to this issue first of all there's obviously a great deal of diversity among the states with regard to the Clean Power Plan what we have worked hard to do along with our colleagues here today is to ensure that flexibility and state options were preserved and certainly reliability and also affordability to give you a sense of where our members come from they are typically appointed by their governors they either inform or advise the governor on energy policy broadly speaking that's as distinct from regulations so many of them the vast majority work on leading comprehensive statewide energy plans and energy in every sector not just electricity so they bring that sort of lens to bear as well as an economic development lens as no surprise to anybody governors and legislators are obviously always focused on economic development as a part of what they do so those are maybe some caveats to how the energy offices have approached this activity just want to touch on a few key points following up a little bit on what Bill said with regard to some of the issues that are being looked at with efficiency one of the areas we focused on in our work has been efficiency because at some place there's broad agreement that there are many low-agrets elements to that work it's certainly a least-cost approach in most cases so we spent a lot of time there and also a little bit about what we've heard recently from our members they did the fortunate having a workshop about two weeks ago and I'll touch on that as well but at first and foremost listening to our states and in the case of our members they look at not only the investor-owned utility efficiency programs which are largely overseen by the utility commissions across the country but also the efficiency programs and policies that the state carries out in other areas whether that's building energy codes efficiency resource standards or importantly from our members' perspective private sector voluntary efficiency efforts the sum total of those sort of non-utility efficiency efforts are significantly larger than the utility efforts from a dollar perspective in the public buildings sector alone there's about six to seven billion dollars in cost effective no cost to the taxpayer, no cost to the rate payer privately financed efficiency improvements in state and local buildings across the country as one example there may be other examples so we look at those opportunities to help integrate that with the plans that states will develop as a solution to help bring down the cost of compliance we think is important one of the I think great benefits of the process that we've had engaging neighborhood, ganasio and many outside stakeholders in the private sector including utilities has been to really broaden the perspective of what efficiency could include and then get into the more difficult challenges of how we count that in a way that's reasonable and appropriate from an air regulator perspective that has to intimate this plan on the state level one of the places that I think I would point you to if you have time after today's event is to look at some of the principles that nasio-mabric and NACA developed before the rule came out addressing a whole range of issues from national energy efficiency registry which I'll address in a moment reliability concerns affordability concerns and many of those things were picked up in EPA's final rule and has made that process better moving on to some of the more recent activities and things we're hearing from our states as I mentioned we had a clean power plan workshop at the nasio annual meeting about two weeks ago on September 16th we had energy officials around the country at the meeting from virtually every state we had senior staff from NACA and from native there as well to provide input and help provide views from each of their organizations and I think the major takeaway is one that Bill actually touched on nicely in his state choices slide and that is there's a lot of diversity in the choices that states have to make in the plans and I think one of the things that we want to be careful to avoid and the advice and help to provide states is not to predetermine which path they take there are reasons a state might take a mass based approach there are reasons states might take a rate based approach what we want to see from a nasio perspective is that we are looking at the cost approaches going forward and principally that includes efficiency but other resources as well I think the other piece that we heard from our members more directly is the clean power plan is certainly having a significant impact on the electricity system but there were many changes a transformation really underway in the electricity sector long before the clean power plan was even considered on the table certainly a huge move toward natural gas because of low cost and also low emissions and a variety of other reasons many new energy efficiency and energy technologies that make higher levels of efficiency possible microboards LED lighting just a whole variety of approaches to energy efficiency into the use of energy and the distribution of energy and the production of energy that weren't available five and ten years ago all of those things are coming to bear in the state planning process that has been going on alongside this activity so it is complicated but I think on the other side of this we have a move toward a really more robust and vibrant electricity sector in the long term when you take into account the investments in infrastructure and resilience that go along with these changes beyond the clean power plan the other I want to touch on is measurement and evaluation measurement and verification EMNV we found generally particularly with investor utility efficiency programs there is a long history and good examples of EMNV there is a long history and great examples in the private sector with energy savings performance contracting the efficiency programs that apply to state and local buildings and a variety of other programs many of those have been noted by EPA by the states, by our organizations and I think the key takeaway is it is important to get the savings verified and get them right I also think it is important to not make the perfect the enemy the good we do have interests in the private sector and public sector of making EMNV I think so difficult that it would make efficiency go from being challenging and a great opportunity to something that would be virtually impossible and so that is an issue we are paying close attention to and we are certainly hearing from our members on that as well one other I think is that all three of the organizations provide but Nancy was taking in a little different direction is responding to our members questions we are setting up a new service called answering state questions that was launched on September 16th we will take questions from any state entity certainly it is focused on state energy offices but it applies broadly to the clean power plan we will take the questions that come in we will refine those if they need to be informed or expanded we will learn a way that hopefully moves everybody forward makes that process efficient and we also have a group of experts including folks from the regulatory assistance project, ACEE other organizations and we will certainly share the questions with but an attempt to respond to the state's questions in this area so I think that is an important new activity again we will focus on trying to walk through the individual questions states have but hopefully those will apply more broadly as the planning goes forward we have a few projects underway that run in parallel to our assistance to states state energy offices in this area that we think of as sort of new regrets activities one of those is work on an energy efficiency registry a national energy efficiency registry this is being carried out by an organization called the climate registry along with several other partners our role in this is working alongside seven states that are not going to be working on the governance rules for that registry led by Tennessee also including Pennsylvania, Georgia, Michigan, Minnesota and Oregon to be clear that registry although it has great application for this particular rule it has great application for many other state activities reaching agreed upon energy goals efficiency goals that the state has meeting other air requirements that are in place and it brings a level of transparency and efficiency credits that are out there and I think it also opens the door to a wider range of efficiency activities some of those private sector efficiency activities that are voluntary in nature for example I think lastly the thing that we're doing most and it's really been something we've been changing our emphasis over the past three or four months we had initially focused largely on national issues with regard to the Clean Power phase rule we have gradually shifted to providing more assistance to the states on an individual basis and certainly a lot of the planning activities, the stakeholder processes that are both underway and need to be underway are something that we'll support with some of our experts on staffs and certainly NAC and Neighbor because we move forward thanks very much David and then we'll turn to our final presenter Charles Gray who is the executive director of New York's National Association of Regulatory Utility Commissioners Chuck has been executive director of New York for well since 1999 and has been working with New York basically for his whole career and we are delighted to have him here today he knows so much about utilities at the state level all of the commissioners how they function, what their needs are so many different issues we are delighted to have you join us thank you thanks Carol for the kind introduction that was very nice and I think we're supposed to be down at 2.30 so I'm going to go very quickly so there's time for Q&A at the end really pleased to see Joe here today EPA has reached out to our members in a way that we've never seen before from very many federal agencies and it's been an exceptional relationship that we've carved out with them so thank you Joe I've had the standard disclaimers that David had as well first these are just my words I'm not speaking on behalf of them and give them a specific name with members and secondly we too have taken no position on the clean power plan we have members that have and I think once the rule is put on the federal register we'll see which side of the litigation our members are not in perspective we'll see members on both sides of the litigation as it goes forward to those of you who don't know what New York does we represent the state utility commission so our members regulate electric service, natural gas service, water telecommunications and all that and regulate their economics so their economic regulators what that means is that the states that the state commissions will have a large say in how the compliance plans are written even though they won't be the principal authors if you will of the plans almost everything the utilities do follow them within a jurisdiction of either the state commissions or FERC federal energy regulatory commission which has been very active in working on this as well they regulate transmission in wholesale market issues as well so we need coordination I think with the three ends I won't go into that any further because I agree with both David and Bill about the importance of all that right now our members are just considering what I call threshold issues and I think we've heard some of them already up here today whether to do their own plan or to defer to the federal plan or to a single state plan or multi state plan whether to participate in the clean energy incentive program whether to ask for more time or whether to do a rate based or mass based approach I think the states are just beginning to digest the rule and as we move forward some of their choices will become clearer one thing we're learning and I appreciate Bill mentioning the money that was not appropriated is that the resource poor right now all of state agencies this is a heavy lift implementing this rule it's something I think from the state commission perspective that we haven't really seen in my tenure which is a long one at this scope and importance moving forward I won't go into that the work the three ends have done together a lot of that we started working together actually back in the Carter the Clinton administration years and years ago and I'm still I can remember that sort of and so we started the relationship about three or four years ago and I think it's been very important to the success that we're likely to have let's see what's taken on the clean power plan our focus is primarily on two issues and David mentioned them as well reliability and affordability we are working very closely with FERC as I mentioned and as they were developing the proposal with the safety the safety valve we didn't take an official position on that but many of our members were quite pleased to see it in the EPA rule when it was issued we anticipate moving forward that quarterly meetings that EPA, FERC and DOE are planning to hold under the rule as I understand it that we have some participation in that we also have representatives on the planning committee of the North American Electrical Liability Corporation sort of an obscure agency called NERC as they prepared to provide technical support and analysis of the impact of the clean power plan on grid reliability just touching on some of the issues that the special issues I mentioned I'll just finish with this what we're hearing from some of our state commissioners as they go forward on what their choices are likely to be in the next few months first question should a state submit a plan or should it defer to the federal implementation plan my sense is that even states that don't particularly care about the care forward the CPP are going to work on plans and the commissions in those states the attorney general may end up mitigating the rule itself but they clearly see the benefit and flexibility and control that doing a state plan gives them so I anticipate there will not be a large number of states that I think they'll certainly probably convince them that I would defer to the federal government should a state request a new extension to file their plans I think from what we're hearing a lot of states are going to ask for extensions although I did see in the trade question that the governor of Pennsylvania has sworn out a stack of bottles to have his plan filed next year so let's see how that goes rate based versus mass based a lot of the discussion there is to be in favor of a mass based approach from the state commissions I think are familiar with how cap and trade programs work have worked in the past with the SO2 into the acid rain program as well as some of the other programs however I also the press today that Georgia looks like they may go for example for a rate based program simply because of the nuclear plants that are built and get credit for so it's advantageous for them to do that they may be in an ironed as a result but we'll see another issue coming up should a state submit its own plan to EPA or opt for a multi-state or regional plan as I think we've heard the electricity grid is not a single state plan it is a regional plan it is inter connections in the United States Texas has its own inter connection but the rest of the other two inter connections actually are in many states the grid is interstate, the markets are interstate and I think we're going to see compliance plans taking that into account there also is I think a growing understanding that multi-state plans can be cheaper can help the be more reliable and more efficient should a state authorize trading as a compliance strategy that sort of goes hand in glove with a multi-state approach and I suspect we're going to see that the real interest in doing trading is a compliance plan going forward there's a growing number of studies that support while we should do that I think the state commissions are going to have a say in how that's structured the trading the trading simply because if it's done by utility it indicates rates it implements costs so the state commissions will have a say in that what we might see is a lot of you know involvement in the state legislatures and the governors on questions like that and we'll see how that unfolds and how that affects what the states are trying to do we've got about four minutes left for Q&A I'll sit right down now, thank you this chat we used it right through a lot of very very important things and I want to thank our panelists for very very thoughtful discussions and let's open it up for a few concise questions from all of you any questions? Okay we'll start over here I have a question for the panel in general what is your sense of a rate based versus a mass based program being more advantageous for implementing renewable energy? first I'll start with the disclaimer I don't want to speak for I don't want to speak for the agency one of the other members on the panel first of all let me just thank my fellow panelists for validating my comment about how hard they and their members are working I think without even trying you illustrated what a huge investment you all have made and I guess the slogan is we're EPA and you're here to help us there are going to be two schools and that's what drove being very even handed and putting out a rate based option and a mass based option there are many people who think that to the extent that 80 megawatt hour that carries with it zero carbon emissions is going to have economic value that's realizable in the electricity market and in the compliance market and there are those who think that under a rate based program the generation of an emission reduction credit in monetizing in the form of an arc in emission reduction credit the value of renewable energy is important and we've heard both sides of that and so we've designed an agnostic program and there may be other factors in the way that are regulated to state level that end up being decisive not the inherent design of the program go ahead are you going to say something though no I'm not ok so there's more to learn about all of that we'll go here and then over to Mark ok here first I wonder if any of the families have looked into the problem of regulatory or religious delays I understand that in 2010 a study of many hundreds of energy life energy projects that have been installed or discontinued because of NEPA aggregation of 45% of those renewable energy so the states wanted to do something innovative that took a new path there could be such problems have you looked into this to see any steps taken to try to minimize those kinds of problems I'll take a shot at this I won't comment on any NEPA delays I can comment on the state and local permitting agencies responses to major projects we've testified this in the past and what we have found is when states receive a complete application a complete application from the entity seeking the permit we act very quickly on those there have been some criticisms in the past that it takes many years to get through some of these permit applications but when you then examine what the reasons were almost without exceptions because we would get a permit from the applicant that just wasn't satisfactory I will make one more comment the dynamic here is very different now we are going to be reliant on a lot of these projects including many of the portfolio standards and the like to meet our compliance strategies and that's going to be important to governments and it's going to be important to other elected officials and non-elected officials in the area and that will place a tremendous amount of pressure we already have the pressure but even more on state and local regulators to make quick actions but we're not going to circumvent the requirements that meet with regard to the review of those projects I have a question where I follow up a similar line and from something Chuck said it's interesting when you think about it cap and trade from the point of the utilities and regulators is irrelevant because suppose the state says we'll do cap and trade the utility still has to make the choice well do I buy some credits or do I do efficiency or renewables and of course if they say I'm going to do efficiency renewables they're simply back at the PUC to make sure we've got the institutional structure to let them make that efficient choice so in a certain sense frequently you hear people say just do cap and trade but the answer is that cap and trade starts the process it doesn't end from the point of view of the regulator that's right I think the state commissions are familiar with cap and trade it's not a new thing when we were working with Waxman Markey there was a lot of state interest in doing that there was a lot of opposition that was very political as well but there was a feeling that we can do this back then and I think we're still seeing that now and I think it's just the start of the decision making process from the utility commission and I want to see is that the right prudent choice that the utility did this versus that and that won't change I think that's going to continue regardless of how the the path that the state takes I would just add to that I think Chuck's absolutely correct as you are but there's an end and the end is Mackenzie's study from 8 or 10 years ago that says we spend in this country on the order of $60 billions a year on energy efficiency not county renewables, just efficiency of that amount there's probably $7 or $8 billion that's under the purview the utilities, the utility commissions now not all the rest is something we can count and aggregate very well but there's obviously a huge amount and so from a cap and trade perspective or an aggregation of that those efficiency savings there needs to be some kind of a certifying body or some kind of departure process to capture those as well and it does begin there but I just think it's going back to the least cost perspective if we leave those other things just lie on the table and don't count them absolutely cause rate payers, consumers, businesses to pay more than they need to for this approach and that's our principal concern about that issue just a quick point your point is well taken all I can say and we are agnostic to the compliance strategy of state pursues whether it's cap and trade or something else but when you talk with northeastern and mid-atlantic officials who have spent the past decade implementing this program they are at the front of the line telling others all the benefits of considering such a program and if this program are called peanut butter and jelly and then cap and trade you know I would it would take off like gang busters but because cap and trade has such sort of a pejorative tone to it people immediately close their eyes but for those who are affected by this all I say is and you're not in the northeastern mid-atlantic spend some time talking with those that have been engaged in this and you will learn as I have how much easier it is they've done all the tough stuff and they've made they have the experience and they've kind of made mid-course collections they will tell you how much easier it is to go in that route than it is to do it on your own but we are agnostic to that but it's just an observation I would share okay, go ahead Hi, my name is standard Murphy I'm running for the House of Delegates in Virginia 47th district we have three trade stations in Boston Virginia Square etc thank you for having this meeting I wanted to know that other than for litigators what incentives for innovation for jobs are built into the clean power plant what can we say to people in Virginia say that there might be incentives for innovation in energy production and green jobs from EPA's perspective we did actually do an analysis that answers that question in part the fact of the matter is that compliance is something that will require investment and maybe try to unite the discussion of a minute ago with the answer to this question it's cap and trade systems, your admission of credit trading systems really just provide the meeting for the market for compliance and the other panel suggested admission reduction credits or alliances that are tradable don't just appear overnight through spontaneous generation someone has to go out and raise capital and hire people to adopt these compliance measures and in some ways we know that this industry will be making hundreds of millions of dollars of investments every year just to keep going if you're willing to respond to changes that they have to face even without environmental controls what environmental controls do is add an increment of spending and hiring to ensure that those investments result in cleaner generation okay we'll take one last question back here this isn't really a question but a response also goes to your question and I think Joe would agree that there was a provision put in the final rule which encouraged states to allow states to include in their plans card utilization which is like using CO2 to create bodies of products and I think EPA included that in order to make sure that that innovative approach which is that innovative approach that shut down by keeping things out of the rules so I think they tried to make sure to keep open the innovative options okay thank you did you have one last question I have one that's kind of a two part question a lot of states are grappling with pretty major policy issues like how to deal with net metering tariffs reforming energy efficiency and renewable mandates at risk nuclear plants in the Midwest so do you see that the power plan as putting an economic value on carbon that outside and if so do you see that as helping states address some of these issues happy to keep it up to stand with this person I think it's a great question and it's what I'm going to be artfully to in my remarks about there are so many other things underway in the electricity sector the energy sector at large but all the things that you mentioned I think it does add a certain value to carbon at least in the thinking about what energy resources a state taps but I do think it also begs that larger question of more comprehensive look at how we do electricity system planning and the policies around that so I think it adds to that so there are a lot of other drivers including other recent state and federal environmental regulations but certainly technologically and the kind of infrastructure investments that are underway for aging infrastructure and electric sector already I think all add to that so I think it's one piece of a larger puzzle and I think it probably adds a bit to that in terms of sense of urgency so a year ago I would have said I don't know when we started developing many of the options we kind of spread the word that we're looking for information from those affected by this proposed role in our final role as to what kinds of opportunities are there from your economic sector that might benefit not only reducing greenhouse gases but also helping their industry and I'm not exaggerating when I say we were inundated with meeting request we probably met with 20 separate industries more than once and we quickly learned that smart stakeholders smart industries view this role as an opportunity whether it's hiring people to a delegates question or whether it's finding a competitive edge it really was quite amazing how you can take this role that many people are complaining about and turn this into an opportunity and one more opportunity that we haven't really talked about that I know we don't have time to is even if somebody just really disliked the notion of reducing greenhouse gases there are collateral very important air quality health benefits that also have job implications by the way that occur from this, reducing fine particles that kill people reducing sulfur dioxide, reducing small-forming emissions all are a collateral benefit from this program so smart people like yourselves should look at this as not just an additional imposition on industry but an opportunity to really gain a competitive advantage Thank you Bill because I think that was a very good way to close this up in terms of really recognizing that while the clean power plan has a key function in terms of how to reduce greenhouse emissions at the same time it was done to make sure that there could be multiple, multiple benefits and other questions with regard to health clean air, clean environment also addressed and so I think that it is an opportunity for a comment also reminded me of a note I received from a board member saying that in August there was a major letter that was sent by a large number of investors to major corporations across the country talking about how important it was for the clean power plan to move forward as opposed to being stopped because of going ahead and looking at all of the opportunities and the need to really address all of these multiple problems that have multiple benefits if we address them so I want to thank all of you for coming I want to thank all of our wonderful wonderful panelists for their very very thoughtful, cheerful presentations a lot of information we will try and have these presentations and everything up on the website as soon as possible I look forward to your further questions please let us know we want to help make sure that all of this is able to proceed in a way that can be as collaborative as what you have seen the work that is going on by these organizations by really trying to look at the issues and how can we solve them together so thank you all very very much for being here


All right, let's get this party started. So this is reporting on Rails, ActiveRecord, and our OLAP working together. My name is Tony. I am Senior Developer at Moby in Indiana. We manage the corporate cell phone accounts for Fortune 500 companies, everywhere from bill optimization to device procurement, including tier one tech support. I work specifically on the billing and reporting team where I basically work in massage with the one million plus devices that we have under management plus all of the billing data that goes back several years. What I essentially do is take information from various sources, carrier billing, tickets from call center, orders placed from carriers, shove them into Postgres, sprinkle some magic on top, and out pops pretty charts and graphs that our clients love. Yeah. So to better explain what reporting is, the best I can do is use my current experience with Moby. Way back in time around 2012, ownership came to the dev team and uttered the dreaded D word. They wanted a bunch of dashboards to report on all the data that we have. And not just one dashboard, dashboards for our client administrators, dashboards for our internal support staff, and dashboards for ownership to actually see how the company's doing. And oh yeah, they want user defined filtering. You can slice and dice by just about any point of data that you want. And various other bits of scope creep that came up over the years. So where do we begin on this? Well, a couple of notes that the dev team laid out in front that we don't want to be bloat in our result set. That means we don't want actual active record objects coming back from the database. Active record is kind of large and we don't really need all that data that's coming back, which means less memory. What we really want is generic uniform data coming back from whatever system we build. This means a plain old bunch of arrays with rows of hashes with the information that we want. That way we can take that, call to JSON on it, shove it into the flavor of the month JavaScript front end framework for charts and we'll be on our way. So what is reporting anyway? Well, I'm going to assume most of us, our apps run against a relational database. A relational database holds data. Data is completely worthless to you and me. Humans can't really work with data. Computers work with data. What humans can work with is information. What reporting in analytics does on a high level is take data converted to information so humans can actually make decisions out of it. And more importantly, reporting answers questions. And this is probably the most important step in preparing your app to generate dashboards is to figure out upfront what questions you want to answer. That means going to all the primary users and ask what do you wanna know? What information do you need? Because if you don't get that and you just start randomly throwing queries against Postgres or MySQL, you'll be throwing spaghetti at the wall and you probably won't end up with a result or a product that people really can use because it doesn't answer the questions that they care about. So here's some examples of questions for each of the three stakeholder groups for mobile reporting. And we wanna answer all of these plus more effectively. So where do we go about doing that? Well, fortunately, there is an industry standard term called OLAP, online analytical processing that is built for data warehousing and analytics. Now, commonly with more traditional OLAP products, everything is rolled up into memory in the form of data cubes, which all the information is pre-slice and diced, pre-group together, everything upfront so you can run queries on it very fast. And OLAP commonly deals with aggregates, counts, max, min, averages. You don't really deal commonly with the individual rows from the data. You care about the grand picture. However, OLAP, you commonly use OLAP with TACON to Oracle products, MySQL products is a bunch of enterprise-y stuff. And when you think enterprise, you think money and we didn't have money. So there's gotta be a better way. Our OLAP to the rescue. This is relational online analytical processing. This is OLAP that runs with SQL, which is what our normal database talks with. It also allows for dynamic queries to be generated on the fly so we can get any information we want out very quickly with just some setup. And what's nice about our OLAP as well is that we can work with both our historical data, which is all the billing information and our transactional data, which is the support tickets that come through to our local support center. The ever-changing lines of service that change on a daily basis. That's transactional, it changes all the time. So our OLAP can work with both while OLAP is more designed for historical information, stuff that happens in the past. Once it's set, you don't touch it anymore.  Now, we're gonna go through all of these and what's nice about OLAP is that you can relate any OLAP terminology to SQL and you can also relate it to something in Rails. So we're gonna use that as examples to build up the vocabulary because when you work with reporting, you wanna think in OLAP terms, not just simple SQL. The first term is a fact model, also known as a fact table. This is the starting point to get information out of the database. In SQL land, this is the from clause, this is the primary table that has the information that you want. In Rails, this is a standard model. So by looking at questions that our users want to answer, we can extrapolate out pretty easily what a fact model is. In this case, the support tickets table and our lines table. A dimension is a way to take your data and slice and dice it into various chunks. Commonly, these are relations to other tables in the database. So foreign keys linking to other tables. It can also be columns that live directly on the fact model as well. In Mobyland, we have cost center living on our lines table. You can group by cost center to get a report out of that or a line of service has a carrier. We have a carriers table. You can link to that to get information out that way. So a dimension in SQL land is always a group by and if you want to jump to another table, it's also a join. In Rails, this is a standard column or a has one or belongs to relationship. So when you look at questions you want to answer for reporting, I always look for the word by. I want something, I want to sum up something by something. So in this case, we have support tickets by type. So we're going to group by type. We have active lines of service group by carrier. So we're going to join against the carriers table and group by carrier. Next up is a dimension hierarchy. This is a way to go up and down a hierarchy of information of your dimension. The most common example is dates. So when you think about I want a group of stuff, a group of orders grouped by day placed, you just group by the day. But I want to go up a level and I say once I want everything grouped by the past five months, everything from the quarter, everything from the year. And hierarchy basically is a structure you build to go up and down from more general groups of data to more specific groups. In Moby land, we have devices. A device has a model number, a manufacturer, an operating system, and wireless technology. That's another example of hierarchy, where you can go up and down your groups of data. A dimension member, or I prefer calling them dimension labels, is actual information that when you look at a result of a report that you can work with. So lines has a carrier ID on it. We could easily group by that, but when you look at it in a table or a pie chart, a human can't make sense of that. So instead a label that you use and shove into the pie chart is the, in that case, the name of the carrier. If the dimension lives on the actual table, so for example, cost center. The cost center is the same thing you group by and also the label. Next up is filters. This is not really an OLAPI term. This is because OLAP is commonly set up for, once you pre-build and slice and dice your data, you don't really have much maneuverability unless you wanna build a completely different data cube to group by or filter by something else. Because we're working with our OLAP, we can use the where clause in SQL to further shrink the data set down or get more specific information. So in SQL, your filter is your where clause. In Rails, this is your the where method, standard active record scopes, or if you use the ransack gem, that results in a where clause as well, which can come in pretty handy. The measure in OLAP terms is basically the aggregate, your average sum, max, min, count, pretty much any aggregate based function that your database can provide. And what you commonly do is the measure is also the column that you plug into the function. So I want the sum of the total charges for an order. That's the measure. It's the sum and the column total charges. The count is obviously the exception because you don't really count on a column. You most commonly use count star in SQL land. Then finally, we have the metric. This is the report. The metric is just a fancy way of asking is the end result of the question that you want. So in SQL, this is the whole query.  Rails, it's all of active records shoved together and execute to the database. So using our examples, the entire question can be the metric or part of the question can also be a metric. What you can do with our OLAP is start with a very simple and specific metric that you wanna ask and then tack on dimensions and more filters later. So you can think of the concept of having a bank of pre-built simple metrics that through maybe a user interface or just through your code, through configuration, you can start tacking on more stuff. So you have a base case and you can expand that out however you want. So I know that's a lot. Here's everything shoved together. Hopefully the colors stand out. But we have a complete question. Whole thing in this case is the metric. You have the sum for your measure. Mobile charges would be, we'll extrapolate the table out of that. That's your fact model or fact table.  So that is your dimension. And a metric can have as many filters and as many dimensions you want. Just keep in mind the more you tack on, obviously the more complex your query is. But this is essentially all of our OLAP in a nutshell with the SQL equivalent and the Rails equivalent. So that's pretty much the industry level of it. How do you go about implementing it? Well first your data has to actually be organized in a way that is conducive to reporting. The most common way is called star schema. There's another setup called snowflake schema which is basically star schema plus plus. I prefer star schema because it's simpler, it's more direct and it's kind of easier to visualize in your head. The idea is if you can take all your tables and chart them out on a graph or link them together, you have fact models or your fact tables in the center of it. And branching off of that is every dimension that you could possibly run against the fact table. And again a dimension can be a simple relation or it can be a column on the fact table. But the end result is when you map them all together it looks like a star. Now a little gotcha in this is pretty much set up for standard SQL is that it's really hard to report on as many relationships. It is possible, you can throw the magical distinct keyword in the front of your query, but if you're on Postgres specifically that can easily result in invalid SQL just because of the way Postgres works. The reason why it doesn't work with has many very well is because when you are aggregating and joining you effectively get multiple rows back, duplicate rows back, and then you're summing against those duplicate rows and then your numbers are off. So avoid wanting to report on has many relationships as much as possible. The other way around this is to use subqueries which is hella slow and I don't recommend that. So using Mobe's example, here's three fact tables that we have identified, support ticket, a line of service, and a row on a bill in all and various dimensions that they can dimension off of. And again some of these are actual relations to other tables and some of them are actual columns on the database, on the fact model. Notice in line, well that actually almost works. We have a carrier and a carrier account. In Mobe, a carrier account has a carrier. So why not just, why is carrier a dimension online and why does line have a separate relation for that? Well, you wanna avoid doing multiple jumps as much as possible with our OLAP. The more joins you do, the slower the result will be. So what we do in Mobe is denormalize a lot of stuff that we wanna group by and put them on directly on the fact model. Now we could get around this with a has one through and effectively have a carrier relationship directly online. The SQL can be generated just fine, but again we're resulting in a double join at that point. Also something interesting to know is created date and the bill date for these two fact tables aren't actual date columns. They're actually separate tables to another relation. This is called a date dimension. And the idea behind this is especially for like a example, a warehouse of sales information. You want information broken down by year, by quarter, by weekday. It's hard to do that with databases, with a common, with a regular date column and have it fast. You can tell MySQL and Postgres take the state column and give me the weekday out and group by that. But it has to be done on the fly and it doesn't use the standard index if you just slap it on the date column. You can make standardized indexes for that, but again Postgres still has to, Postgres and MySQL have to calculate those values on the fly. Instead you have a separate table with a row for every day that you effectively care about. So in case of Moby, it's beginning of Moby's existence to 15 years from now just to cover all of our bases. And instead of having a date column on support tickets, we actually have a created at ID that links to a date dimension. And so what we can do then is say, give me all the support tickets broken down by quarter. So what we do is then we join against the date dimensions table, group by the quarter column, that's the label. And now we can easily report on that. This also allows you to, since each row in the date dimension already has the various parts of the date broken down, you effectively have a very complex hierarchy that you can go up and down the data as you see fit. So great, ActiveRecord can do all that, right? Why is Tony up here with his free ticket to RailsConf? Well it is true that ActiveRecord does have, does provide all the information needed to actually construct our OLAC queries. It can do a join, it can do a grouping. You can ask it for all of the, you can reflect on all the relations. You can ask for all the attributes on the model. And you can select out very specific columns using the pluck method. However, it does have some limitations. There is really no good way to group by the non-aggregate columns programmatically without manually putting this in. This is a specific gotcha for Postgres. MySQL doesn't have this problem, you can cheat. But with Postgres, if you have an aggregate in your select clause in the non-aggregate columns, you must include those columns in the group by, otherwise it considers it invalid SQL because it technically is. And so you have to make sure you balance the select and the group by and ActiveRecord can't really do that. In fact, it's mostly built for the count method, the maximum method, the minimum method. You just plug in one column and that is the number you get back. You don't get the grouping, you don't get the nice dimension label with that. And there's also not a good way to just have your models be described in RO-lappy terms. Like yes, you have a has one, you have has belongs two, but there's no way to actually say that these are dimensions. You can't actually just go out and list all of them without iterating through every possible relation in the table plus the standard attributes. And there's no really good way to just store pre-made queries very well. Yes, ActiveRecord foreign later does lazy loading so you can start tacking on a select, you can override the from, you can put on a where, and it won't execute it until you actually need to iterate over it, but there's no way to just grab something real quick and then start tacking on stuff pretty quickly. So what could we do? Well, we could hard code all of queries. That's great, except good luck trying to define custom where clauses and custom joins because as part of the requirements we had, we could build a courier ourselves, which is actually what we ended up doing. However, for commonly, I would think a normal Rails developer would just start tacking on extra methods to ActiveRecord to say, you know, give me all the dimensions and effectively dirty up the entire class at that point, which we really don't want. Or it could switch to a SQL. There's a, that's a great gem. It's good replacement for ActiveRecord. There's a much better way to build and define very complex queries on the fly compared to ActiveRecord. However, that ship has sailed quite a long time ago and I don't think management was really up for us to rewrite the entire app. So we had to do another way. And so what we did is we defined our own library for reporting. What I did was recently I extracted out most of the non-mobile logic, sort of clean roomed a lot of the stuff and implemented it in an open source gem. I call it Active Reporting because I'm terrible at naming. But basically this provides a DSL-like system so you can tell your app very stuff in RO-lappy terms. It's a very lightweight DSL. And what it does, it uses ActiveRecord and it asks ActiveRecord for bits of information about the database and about all the tables, tells it how to build the query for you and it just executes it directly on the database. And instead of ActiveRecord objects coming back, you just get an array of hashes at that point. Very simple, lightweight and small data set back with the information that you actually want. And it doesn't really dirty up ActiveRecord too much. I think it adds one method and maybe two at this point. I would say it's mostly production ready. Video games got in the way for me to build a demo app. But 0.1.1 is out. DSL's pretty much in a good spot. Documentation is pretty much what I need at this point. But this is effectively how it works. For every model you have in your app, you have a fact model to go with it if you want it to be reported on effectively. I'm calling this effect model instead of a fact table because we're modeling how it's used within our OLAP. Because Rails is convention over configuration, the idea is you have your ActiveRecord model name, fact model as your entire class and it'll just know to link to the proper model. And there's obviously a way to override it if you're so inclined. But the idea is all the reporting stuff gets shoved into these classes and not your regular models at that point. So with your fact model, you then define the dimensions that you want to work with. Now why are we whitelisting all this stuff instead of just saying, hey, ActiveRecord model, give me all of your relations, anything that has one or belongs to, what we can mention by, anything that's an attribute that we could probably group by, let's just use that. Well, what if we want a user interface where we can change the charts and graphs on the fly? Instead of, in Moby, I want all of my lines grouped by carrier, I want them instead grouped by carrier account. And maybe we'll have a dropdown saying I want to change this report altogether, change the dimension. So what we can do then is each fact model we can ask it for what dimensions it can work with. And the gem knows if it needs to join against another table because it's a relation or if it's an actual attribute just grouped by that. You can also define the hierarchy and the actual default dimension label. So if a dimension is a relation, the gem will assume that the default label will be a name. So line joins to carrier, carrier, table has a name, we use that as the label, or we can override that if we see fit. And then we can also define the hierarchy which effectively makes more dimensions. And so we can have a nice line graph of orders over time and I want to see it by date, now I want it by month, now I want it by year, now I want it by quarter. So this allows you to set up a hierarchy to drill up and drill down your data as needed. Your dimension filters, again, these are just where clauses and the fact model can then whitelist stuff that you can filter by. And again, why are we whitelisting this stuff? Because this can be possible user input. Scopes on a active record model are just glorified class methods. What's also a class method?  So we don't want to just blindly allow any input being coming in from a form to call methods that are not really safe. So instead we whitelist on our fact models what a user or whoever's building the report can actually filter stuff by. And this can be done by just listing out pre-built scopes from the model, so it'll just whitelist those. You can define your own dimension filter using the same scope DSL, so throwing in a lambda with an input if you're so inclined. This allows you to not have to tack on all your known filters to your model. If you don't need to use them in the rest of the app you can throw them just all in the reporting. So that keeps your models slimmer. Or if you happen to have the ransack gem loaded up you can whitelist various ransack calls as well. The other benefit of specifying dimension filters manually is now you have effectively full control or mostly full control over what the ware clauses will be in the report. Active record isn't always the smartest in building optimal SQL on the fly. So if you can control that to maybe force using specific indexes or maybe force a union instead of an or you can do that. So that's a setup. Here's the actual execution. The gem has a concept of a metric and again a metric is the question you wanna answer. You build a metric by giving it a name as the first argument. You tell it the fact model you want the metric to be based off of. Then you can pass in dimensions, filters. You can set the aggregate, it defaults to sum. You can set the measure of the actual column that you want to sum max min on. It defaults to value, I think you can override that as well. But this builds an object that holds the question and all the information that it needs to reach out to the fact models to then reach out to Active Record to get all the information and build the query that you actually wanna run. And then finally you shove it into a report object. The report is effectively just a glorified courier that takes the metric and says build the SQL then ActiveRecordBase.connection.execute SQLGo. Yay, here's your very basic result set back. Now why are these separate objects? Well, as I mentioned in a previous slide a metric can be a very simple question you wanna answer and then tack on more stuff. The Active Reporting Report Object will allow you to take a metric and then merge in user input from the interface to say I wanna tack on the carrier dimension or no, I wanna change it to something else. Here's my form of all my filters for these reports. Take that hash, shove it in there. It'll go through the wide list and apply the where clause dynamically at that part. This is the power of our OLAP again because you can define a where clause. You can define pretty much anything on the fly as long as it'll result in proper SQL and get data back on it. So we built those two objects. This is the resulting SQL. You have the select clause is very specific to what you want. We are summing on the total charges column. The gem will give you whatever the metric name is as the aggregate result column. We are dimensioning on carrier. So we are going to then grab the carrier label which is the name. The gem has a nice ID that you can turn off where you can get the identifier back. So if you wanna build filters on the fly, embed the identifier column of the dimension in a pie graph, you click the pie graph and then your filters magically update to have sales impress potential clients which they never use the feature later anyway. But anyway, we built us the clause from the fact table. We then have to join on our dimension. We apply our dimension filter, our where clause and then we finally do the group by because we're in Postgres and we have to be valid query. And the end result for that, we called out run on it and we get back an array of simple hashes. Then we call to JSON on it or whatever we can massage it later with another service object if we so want to and then spit out a pretty chart, a table, a large number, whatever we wanna do. That's effectively all the gem does because again, reporting isn't about getting a table back of rows. We just want back aggregates of actual information that we care about. And so finally, just some pro tips in general for databases if you want to do reporting on them or any form of way of getting information out. As mentioned before, try to avoid double jumps as much as possible with your queries. Sometimes denormalizing is a valid solution. It's much easier in Moby to ask, give me all my active lines by carrier because carrier ID is directly on the table. We don't need to do a double jump at that point. And we just keep the carrier counting, carrier in sync from a very simple, an active record callback or you can even just use a database trigger if you're so inclined. You can also cheat around some has-minis by implementing countercashes, both the built-in countercash plugin or just manually generated pre-built counts through background jobs or whatever processes you want. That way you have some data pre-built and pre-set up for you so you can easily aggregate against that. Also index wisely if you missed the previous talk about some database optimizations with indexes. Before this, look that up. It was pretty informative about when to index, when not to index and current gotchas with that. But the common rule is if you're going into mention by something at the foreign key, you might as well index that. It would probably help if you're indexing, if you have common filters that you're gonna be filtering by a lot.  You can then use that to determine, I'm probably gonna need to index these columns or these groups of columns. And use explain analyze as much as possible. This query is taking 50 seconds. Why is it taking 50 seconds? Well, we have tools that our database provides that tells you exactly what the database is doing. And oh, I missed an index. Now it's suddenly half a second. Yay. So use the tools handy to optimize queries because this is still SQL. It's still a regular database. All we're doing is just dynamically building a query to run.  Anything reporting related, have it hit the read only because you're not doing writes and your master can take the day to day operations at that point. Or if you're in Postgres, look into sharding or even schema separation if you're a multi-tenant app. That way you have physically less data for the database to work with per client. So you only have slow queries for your biggest clients and you rest the clients that are smaller don't really have to take a hit. And you can focus on optimizing that one client as opposed to having to take a bunch of unhappy users at that point. So that's about all the rambling I have. Jim's on GitHub and released on Ruby Jim's as well. Copy the slides if you're so inclined. I have a GitHub repo called show and tell. That's where I put all the talks I've been doing. I don't Twitter much, I follow people, but if you're one too, I'm on Twitter.  Okay, we're done early.