Subject | Re: [firebird-support] Performance Question |
---|---|
Author | Todd E. Brasseur |
Post date | 2004-05-19T18:48:14Z |
Johannes Pretorius wrote:
the database with the problem the last time, but I would guess about 90,000.
I can't do your tests because the database has been repaired (backup and
restore). All I know is that the stored procedure does a:
Update Taxpassoff set rawimpr=0, rawland=0, rawtotal=0
where propid = :propid and assessmentyear = :assessmentyear;
Only three of the records get set to 0. The fourth record doesn't.
Later in the procedure there is an update statement that says:
Update Taxpassoff set rawimpr = rawimpr+1234
where propid = :propid and assessmentyear = :assessmentyear and
assessment_code = :assessment_code;
This updates the record that didn't get set to 0. So the end result is
that the record continually gets incremented. The other weird thing is
that in one report where we show all the records from this table for the
one propid, only three records show up. But when we run a summary of
all the values in the table (sum(rawimpr), group by propid)), then the
value in all four records is included in the sum.
Todd
> Good dayThe table has 15 columns. I don't know exactly how many rows were in
> =-=\=-=\=-\
> I only can provide a way I would test it to see if there is a way to fix
> the problem. I
> hope that this will be helpful.
>
>
> At 04:32 19/05/2004, you wrote:
> >It is strange:
> >
> >What will happen is a 'ghost' record will appear. If I do a:
> >
> >Select * from taxpassoff where Propid = 1220000000
> >
> >I will get four records (All showing that they have AssessmentYear =
> 2004)
> >
> >If I change the select to:
> >
> >Select * from taxpassoff where Propid = 1220000000 and AssessmentYear
> = 2004
> >
> >I only get 3 records. AssessmentYear and PropID are both INTEGERS.
> >
> >If I change the select to:
> >
> >Select * from taxpassoff where Propid = 1220000000 and
> >cast(AssessmentYear as INTEGER) = 2004
> >
> >I will see all four records.
> >
> >This table may have 120,000 records in it and every once in a while
> >there will be 1 to 4 records that have done this.
>
> You can try by updating these values in question to itself, to do a force
> rewrite of the
> value and see if it corrects the query problem,
>
> you can run for instance
>
> update taxpassoff set AssessmentYear = AssessmentYear where Propid =
> 1220000000
>
> then redo your select
>
> Select * from taxpassoff where Propid = 1220000000 and AssessmentYear
> = 2004
>
> If this still returns 3 rows then do this update
>
> update taxpassoff set AssessmentYear = 2004 where Propid = 1220000000
>
> then do the select again.
>
> If it then returns 4 rows then there is a possible index corruption on
> writing the index values.
>
> Out of interest sake, how many rows and columns does this table in
> question
> have at the moment ??
the database with the problem the last time, but I would guess about 90,000.
I can't do your tests because the database has been repaired (backup and
restore). All I know is that the stored procedure does a:
Update Taxpassoff set rawimpr=0, rawland=0, rawtotal=0
where propid = :propid and assessmentyear = :assessmentyear;
Only three of the records get set to 0. The fourth record doesn't.
Later in the procedure there is an update statement that says:
Update Taxpassoff set rawimpr = rawimpr+1234
where propid = :propid and assessmentyear = :assessmentyear and
assessment_code = :assessment_code;
This updates the record that didn't get set to 0. So the end result is
that the record continually gets incremented. The other weird thing is
that in one report where we show all the records from this table for the
one propid, only three records show up. But when we run a summary of
all the values in the table (sum(rawimpr), group by propid)), then the
value in all four records is included in the sum.
Todd
>[Non-text portions of this message have been removed]
>
>
> I hope it helps
>
> Johannes
>
> ----------
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> <http://www.grisoft.com%29.>
> Version: 6.0.687 / Virus Database: 448 - Release Date: 16/05/2004
>
>
> [Non-text portions of this message have been removed]
>
>
> ------------------------------------------------------------------------
> Yahoo! Groups Links
>
> * To visit your group on the web, go to:
> http://groups.yahoo.com/group/firebird-support/
>
> * To unsubscribe from this group, send an email to:
> firebird-support-unsubscribe@yahoogroups.com
> <mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service <http://docs.yahoo.com/info/terms/>.
>
>