<div dir="ltr"><div>I&#39;m looking for some ideas here:</div><div><br></div><div>I&#39;m working with a large Postgresql database.  It&#39;s getting too large and busy. There is an existing DBIC schema for this database that is used by a number of applications and tools.  </div>

<div><br></div><div>There is a subset of tables in this database that are mostly isolated from the other set of tables (i.e. joins are rare).  So, one thought here is to pull this subset of tables out into a separate database.</div>

<div><br></div><div>But, then how to minimize the changes needed to all existing code that uses DBIC for accessing this database?</div><div><br></div><div>One option is to hunt down every use of $schema for the subset of tables and replace it with $other_schema. </div>

<div><br></div><div>But, is there anything I might do that is a bit more &quot;clever&quot;?:</div><div><br></div><div><div>$schema-&gt;resultset( &#39;Foo&#39; )  # uses one database</div><div>$schema-&gt;resultset( &#39;Bar&#39; )  # uses a different connection</div>

</div><div><br></div><div>so the existing application code would not requires so many changes?  (And, no, I&#39;m not expecting joins to work across those.)</div><div><br></div><div>That is, perhaps have two $storage objects and swap them out based on the result source.</div>

<div><br></div><div>I&#39;m sure it&#39;s not that simple -- for example thawing serialized DBIC objects would need to have the correct storage associated, too.</div><div><br></div><div>Any other ideas?</div><div><br></div>

<div><br></div><div><br></div>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a>
</div>