Subject | Re: How to improve Firebird performance on a large table? |
---|---|
Author | trskopo |
Post date | 2013-03-04T09:40:47Z |
Dear Alan,
Thanks for your reply.
This is my table ddl :
CREATE TABLE LOG
(
ID Integer NOT NULL,
ID_TBL Integer NOT NULL,
TBL_NM Varchar(40) NOT NULL,
OPR Char(1) NOT NULL,
LOG_AT Timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
SNC Smallint DEFAULT 0,
PRIMARY KEY (ID)
);
I think, I found the problem.
I made a small app that seek for snc's value every second. It seems makes firebird server works heavily.
Changing seeking time from 1 second to 10 seconds seems solved the problem.
Thanks anyway for your suggestions.
Best regards,
Anto.
Thanks for your reply.
This is my table ddl :
CREATE TABLE LOG
(
ID Integer NOT NULL,
ID_TBL Integer NOT NULL,
TBL_NM Varchar(40) NOT NULL,
OPR Char(1) NOT NULL,
LOG_AT Timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,
SNC Smallint DEFAULT 0,
PRIMARY KEY (ID)
);
I think, I found the problem.
I made a small app that seek for snc's value every second. It seems makes firebird server works heavily.
Changing seeking time from 1 second to 10 seconds seems solved the problem.
Thanks anyway for your suggestions.
Best regards,
Anto.
--- In firebird-support@yahoogroups.com, Alan J Davies <Alan.Davies@...> wrote:
>
> Without knowing your setup, its difficult to say. You may have 100
> fields in each record? In a network environment try to minimise the
> amount of network traffic.
> So, you should try to refine your select statement by returning only
> what you need e.g.
> instead of >Select * from table where field_value = 1.
> try:
> select field_value,field_value1,field_value2,field_value100
> from table
> where field_value = 1 (and field_value2=2)
> order by field_value,field_value2 (aim for more selective index - 2
> fields, not just 1)
> then even better:
> What do you want to do with the returned data? View it? Can you handle
> more than 20 records at a time on your screen?
> select first 20 field_value,field_value1,field_value2,field_value100
> from table
> where field_value = 1 (and field_value2=2)
> order by field_value,field_value2
>
> Good luck
> Alan
>
> Alan J Davies
> Aldis
>
>
> On 04/03/2013 06:18, trskopo wrote:
> > Hi all,
> >
> > I have a table with about 5,000,000 records and it's growing.
> >
> > I run slq statement like this :
> >
> > Select * from table where field_value = 1.
> >
> > Table already indexed on field_value (int type).
> >
> > On local hardisk, where there is only 1 user and no update/edit/insert
> > operation, it took about 1-2 seconds to get the result, but on Local
> > Area Network, where there about 20 users attached to that database, lots
> > of update/edit/insert operation on this table,it took almost 20 seconds.
> >
> > Is there any tips / methods to improve performance?
> >
> > Thanks and regards,
> > Anto.
> >
> >
>