The design is stable until the business model changes.  Which is the
case with R&D projects as they are constantly changing.  The
applications we are writing are things that do not exist in any
capacity in the market.  Which makes "stable" a relative term when
comparing it to a banking or warehousing situation.  Also, keep in
mind that the applications we are writing are quite large with a large
user base and we have a very small team (over half are junior
developers).  In an R&D capacity, faster turn around is key, so having
the ability to lower maintenance code changes is vital.

Some possible maintenance issues:

  - changing all the sql to get the new column.
  - having different names for your aliases from query to query become
confusing.

Also, I'm not sure what you mean by a "hash array".  I am guessing you
are getting a hash or hash reference.  I too am using the
fetchrow_hashref, however it drops the table prefix on the return
column names, which in turn clobbers column names that are the same
across tables.  Thus the reason for this thread.

I was really just looking for any future planning done on the DBI side
of things to aid with getting back full information.  Either a flag to
pass into the function call, or new functions which return the table
names prefixed as you would see when running the SQL directly from a
console.  It seems that other languages, such as Java, do not seem to
have is issue, both ways of retrieval are possible.  If the
fetchrow_hashref were changed to house both types of keys (those
without table prefixes and those with), in the way Java and other
languages work, then this would be a mute point.

-Link

On Tue, Aug 11, 2009 at 1:25 AM, Jared Still<[email protected]> wrote:
> On Thu, 2009-08-06 at 10:23 -0400, Link McGaughey wrote:
>
>> ...aliasing each of the column names, but this becomes a maintenance
>> issue when you have alter the selected columns every time there is a
>> change to the table.
>
> Personally, I would work on stabilizing the design.
>
> Tables frequently being changed would indicate to me that whoever is
> designing the tables is not yet sure what to do with them.
>
> I'm curious as to just what the maintenance issues are?
>
> Normally I would expect to see all SQL statements packaged together
> somehow, and each SQL statement appears only once.
>
> Personally, I use a hash array, version them according to
> database version.  This simplifies changes a bit.
>
>
>> SELECT *
>> FROM
>>    table1 t1
>>    JOIN table2 t2 ON (t1.column_id = t2.column_id)
>> WHERE
>>    ...
>>
>
> In general, using 'select *' is not a good practice.
>
> One good reason is that it is a resource hog.  It takes
> a fair amount more resources to do 'select *' rather than
> just selecting just the needed columns, especially when a
> small percentage of the columns are actually used.
>
> Yes, I know you didn't ask, but thought you would like to know.
> It's not too hard to test this yourself.
> I've done so on Oracle, but not on MySQL.
>
> And no, I don't care if 'select *' is easier to code.  :)
>
>
>
>

Reply via email to