Subject | Re: Best performance |
---|---|
Author | Adam |
Post date | 2005-05-03T23:29:26Z |
I got lost after the first query, but admitedly I only have 10
minutes to check this list at the moment.
But from my experience,
Computed By fields should NOT involve other tables. It is incredibly
slow, and with any more than a couple of records, it is unusable
(exponentially slow)
Is your real table structure (ie excluding computed fields) something
like?
TableA
(
ID,
Field1,
Field2
)
TableB
(
ID,
TableAID
)
etc
if so, you do not need to put the computed fields into tableA, just
join them. If TableAID is a foreign key constraint, the index will
(in most cases) give you the performance you are after. If you still
need the computed fields in TableA (for other reasons), consider
using actual fields and having triggers fill them. That way they are
calculated on the insert and update (relatively rare) rather than the
(generally more common) select.
Adam
--- In firebird-support@yahoogroups.com, "Edson T. Marques"
<marques@o...> wrote:
minutes to check this list at the moment.
But from my experience,
Computed By fields should NOT involve other tables. It is incredibly
slow, and with any more than a couple of records, it is unusable
(exponentially slow)
Is your real table structure (ie excluding computed fields) something
like?
TableA
(
ID,
Field1,
Field2
)
TableB
(
ID,
TableAID
)
etc
if so, you do not need to put the computed fields into tableA, just
join them. If TableAID is a foreign key constraint, the index will
(in most cases) give you the performance you are after. If you still
need the computed fields in TableA (for other reasons), consider
using actual fields and having triggers fill them. That way they are
calculated on the insert and update (relatively rare) rather than the
(generally more common) select.
Adam
--- In firebird-support@yahoogroups.com, "Edson T. Marques"
<marques@o...> wrote:
> Ok!rows".
> That was a way I found to explain my problem (poor I know!).
> In the real database those tables have complete structure with the
> apropriate indexes for the relationships and "substancial number of
> I'm having this problem with this database I'm working on. Theactual
> structure was made using those computed fields, so I fall in doubt.set),
> If I change this structure, if I eliminate those computed fields
> (optionally, you know, I can make joins to obtain the same result
> will I have best performance if I do this (changes)?and,
>
> Martijn Tonies escreveu:
>
> >Hello,
> >
> >
> >
> >
> >>If my data base has a table that is related with ten other tables
> >>in each one of these ten tables exists one field that I have thatto
> >>show together in a consultation with the first table. What ofthis two
> >>options goes to give the best performance?performance
> >>
> >>
> >
> >Well, basically, the one that gives you the best performance is the
> >one that gives you the best performance.
> >
> >Given that you did not create any indices or keys, I suspect
> >(on non-empty tables with a substantial number of rows) is bad ineither
> >case.& MS SQL
> >
> >With regards,
> >
> >Martijn Tonies
> >Database Workbench - developer tool for InterBase, Firebird, MySQL
> >Server
> >Upscene Productions
> >http://www.upscene.com
> >
> >
> >
> >Visit http://firebird.sourceforge.net and click the Resources item
> >on the main (top) menu. Try Knowledgebase and FAQ links !
> >
> >Also search the knowledgebases at http://www.ibphoenix.com
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >