What exactly is simple inheritance? With what I have below, it doesn't
create any addiotional tables. How will I be able to query only votes
for Items?
On Tue, May 13, 2008 at 5:17 PM, Alex <outroa...@gmail.com> wrote:
> What exactly is simple inheritance? With what I have below, it doesn't > create any addiotional tables. How will I be able to query only votes > for Items?
But with column aggregation I also have to define an additional column manually. It generates a TYPE column, but then I also need to create a TYPE_ID column so that the vote corresponds to the right item or topic.
What's the ideal solution?
- alex (from iphone)
On 14-May-08, at 11:51 AM, "Jonathan Wage" <jonw...@gmail.com> wrote:
> Simple inheritance is one table with all columns on the parent.
> You want something like column aggregation inheritance it sounds like.
> - Jon
> On Tue, May 13, 2008 at 5:17 PM, Alex <outroa...@gmail.com> wrote:
> What exactly is simple inheritance? With what I have below, it doesn't > create any addiotional tables. How will I be able to query only votes > for Items?
On Wed, May 14, 2008 at 11:20 AM, Alex <outroa...@gmail.com> wrote: > But with column aggregation I also have to define an additional column > manually. It generates a TYPE column, but then I also need to create a > TYPE_ID column so that the vote corresponds to the right item or topic.
> What's the ideal solution?
> - alex (from iphone)
> On 14-May-08, at 11:51 AM, "Jonathan Wage" <jonw...@gmail.com> wrote:
> Simple inheritance is one table with all columns on the parent.
> You want something like column aggregation inheritance it sounds like.
> - Jon
> On Tue, May 13, 2008 at 5:17 PM, Alex < <outroa...@gmail.com> > outroa...@gmail.com> wrote:
>> What exactly is simple inheritance? With what I have below, it doesn't >> create any addiotional tables. How will I be able to query only votes >> for Items?
> I think that column aggregation is the best solution right now.
> - Jon
> On Wed, May 14, 2008 at 11:20 AM, Alex <outroa...@gmail.com> wrote: > But with column aggregation I also have to define an additional > column manually. It generates a TYPE column, but then I also need to > create a TYPE_ID column so that the vote corresponds to the right > item or topic.
> What's the ideal solution?
> - alex (from iphone)
> On 14-May-08, at 11:51 AM, "Jonathan Wage" <jonw...@gmail.com> wrote:
>> Simple inheritance is one table with all columns on the parent.
>> You want something like column aggregation inheritance it sounds >> like.
>> - Jon
>> On Tue, May 13, 2008 at 5:17 PM, Alex <outroa...@gmail.com> wrote:
>> What exactly is simple inheritance? With what I have below, it >> doesn't >> create any addiotional tables. How will I be able to query only votes >> for Items?
On Wed, May 14, 2008 at 12:02 PM, Alex <outroa...@gmail.com> wrote: > What would be an alternate solution?
> - alex (from iphone)
> On 14-May-08, at 1:43 PM, "Jonathan Wage" <jonw...@gmail.com> wrote:
> I think that column aggregation is the best solution right now.
> - Jon
> On Wed, May 14, 2008 at 11:20 AM, Alex < <outroa...@gmail.com> > outroa...@gmail.com> wrote:
>> But with column aggregation I also have to define an additional column >> manually. It generates a TYPE column, but then I also need to create a >> TYPE_ID column so that the vote corresponds to the right item or topic.
>> What's the ideal solution?
>> - alex (from iphone)
>> On 14-May-08, at 11:51 AM, "Jonathan Wage" < <jonw...@gmail.com> >> jonw...@gmail.com> wrote:
>> Simple inheritance is one table with all columns on the parent.
>> You want something like column aggregation inheritance it sounds like.
>> - Jon
>> On Tue, May 13, 2008 at 5:17 PM, Alex < <outroa...@gmail.com><outroa...@gmail.com> >> outroa...@gmail.com> wrote:
>>> What exactly is simple inheritance? With what I have below, it doesn't >>> create any addiotional tables. How will I be able to query only votes >>> for Items?
On Wed, May 14, 2008 at 2:07 PM, Jonathan Wage <jonw...@gmail.com> wrote: > Just having a model with record_type and record_type_id, and you would set > the fields yourself?
> - Jon
> On Wed, May 14, 2008 at 12:02 PM, Alex <outroa...@gmail.com> wrote:
>> What would be an alternate solution?
>> - alex (from iphone)
>> On 14-May-08, at 1:43 PM, "Jonathan Wage" <jonw...@gmail.com> wrote:
>> I think that column aggregation is the best solution right now.
>> - Jon
>> On Wed, May 14, 2008 at 11:20 AM, Alex < <outroa...@gmail.com> >> outroa...@gmail.com> wrote:
>>> But with column aggregation I also have to define an additional column >>> manually. It generates a TYPE column, but then I also need to create a >>> TYPE_ID column so that the vote corresponds to the right item or topic.
>>> What's the ideal solution?
>>> - alex (from iphone)
>>> On 14-May-08, at 11:51 AM, "Jonathan Wage" < <jonw...@gmail.com> >>> jonw...@gmail.com> wrote:
>>> Simple inheritance is one table with all columns on the parent.
>>> You want something like column aggregation inheritance it sounds like.
>>> - Jon
>>> On Tue, May 13, 2008 at 5:17 PM, Alex < <outroa...@gmail.com><outroa...@gmail.com> >>> outroa...@gmail.com> wrote:
>>>> What exactly is simple inheritance? With what I have below, it doesn't >>>> create any addiotional tables. How will I be able to query only votes >>>> for Items?
You can look at the space wasted in percentages.
Also, every query will have to check the type field.
IMHO, column aggregation should be considered only if you have many
different inherited classes with small tables (up to a few thousands
of rows). In your case, concrete seems more convenient.
Cheers
2008/5/15 Alex:
Well, you only get an additional 2 columns, one tinyint and one
integer, per row. Is that such a waste?
For some reason duplicating the same table structure twice seems
icky, though it might not be.
On Wed, May 14, 2008 at 8:40 PM, colnector wrote:
Doesn't this create comment_id and item_id in the same votes
table?
How is that better than using 'concrete inheritance' where
different
tables are created?
One should always consider what's going on behind the scenes
in the
DBMS. It seems to me that using column aggregation as
presented here
is wasteful of both time and space.
On May 14, 9:13 pm, Alex <outroa...@gmail.com> wrote:
> On Wed, May 14, 2008 at 2:07 PM, Jonathan Wage <jonw...@gmail.com> wrote:
> > Just having a model with record_type and record_type_id, and you would set
> > the fields yourself?
> > - Jon
> > On Wed, May 14, 2008 at 12:02 PM, Alex <outroa...@gmail.com> wrote:
> >> What would be an alternate solution?
> >> - alex (from iphone)
> >> On 14-May-08, at 1:43 PM, "Jonathan Wage" <jonw...@gmail.com> wrote:
> >> I think that column aggregation is the best solution right now.
> >> - Jon
> >> On Wed, May 14, 2008 at 11:20 AM, Alex < <outroa...@gmail.com>
> >> outroa...@gmail.com> wrote:
> >>> But with column aggregation I also have to define an additional column
> >>> manually. It generates a TYPE column, but then I also need to create a
> >>> TYPE_ID column so that the vote corresponds to the right item or topic.
> >>> What's the ideal solution?
> >>> - alex (from iphone)
> >>> On 14-May-08, at 11:51 AM, "Jonathan Wage" < <jonw...@gmail.com>
> >>> jonw...@gmail.com> wrote:
> >>> Simple inheritance is one table with all columns on the parent.
> >>> You want something like column aggregation inheritance it sounds like.
> >>> - Jon
> >>> On Tue, May 13, 2008 at 5:17 PM, Alex < <outroa...@gmail.com><outroa...@gmail.com>
> >>> outroa...@gmail.com> wrote:
> >>>> What exactly is simple inheritance? With what I have below, it doesn't
> >>>> create any addiotional tables. How will I be able to query only votes
> >>>> for Items?
> You can look at the space wasted in percentages. > Also, every query will have to check the type field.
> IMHO, column aggregation should be considered only if you have many > different inherited classes with small tables (up to a few thousands > of rows). In your case, concrete seems more convenient.
> Cheers
> 2008/5/15 Alex: > Well, you only get an additional 2 columns, one tinyint and one > integer, per row. Is that such a waste?
> For some reason duplicating the same table structure twice seems > icky, though it might not be.
> On Wed, May 14, 2008 at 8:40 PM, colnector wrote:
> Doesn't this create comment_id and item_id in the same votes > table? > How is that better than using 'concrete inheritance' where > different > tables are created? > One should always consider what's going on behind the scenes > in the > DBMS. It seems to me that using column aggregation as > presented here > is wasteful of both time and space.
> On May 14, 9:13 pm, Alex <outroa...@gmail.com> wrote: > > How does this look?