Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index made on unedited column doesn't work [CORE5556] #5823

Open
firebird-automations opened this issue May 31, 2017 · 3 comments
Open

Index made on unedited column doesn't work [CORE5556] #5823

firebird-automations opened this issue May 31, 2017 · 3 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Přemysl Šťastný (stastnypremysl)

I had defined this table, which has a few row:
create table ODB_DOC_PRODUKTY_PARAMETRY (
PKID PKID,
PARAMETR PARAMETR,
HODNOTA TEXT5000_UTF,
ZAVISLOST_PARAMETR PARAMETR,
ZAVISLOST_HODNOTA TEXT5000_UTF,
EDITOVATELNOST LOGICAL3,
constraint ODB_DOC_PRODUKTY_PARAMETRY_PKID primary key (PKID))

I executed this script:
set term ^;
create domain DOCSKUPINA varchar(50) default 'ALL' not null^
alter table ODB_DOC_PRODUKTY_PARAMETRY add SKUPINA DOCSKUPINA^
create index ODB_DOC_SKUP_PARAM_PARAM on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, PARAMETR)^
create index ODB_DOC_SKUP_PARAM_ZAVISLOST on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, ZAVISLOST_PARAMETR)^
commit^
set term ;^

Now, when I try to:
select A.SKUPINA
from ODB_DOC_PRODUKTY_PARAMETRY A
where A.SKUPINA = 'ALL';

I get nothing.

When I
insert into ODB_DOC_PRODUKTY_PARAMETRY(PARAMETR) values ('para')

I get only the inserted row.

But when I deactivate indexes or
update ODB_DOC_PRODUKTY_PARAMETRY A
set A.SKUPINA = 'ALL';

I get all the rows.

_________________________________________________________________________________________
Better example:
set term ^;
create table TRASH (
PKID int
)^
commit^

insert into TRASH(PKID) values (1)^
insert into TRASH(PKID) values (2)^
insert into TRASH(PKID) values (3)^
insert into TRASH(PKID) values (4)^
insert into TRASH(PKID) values (5)^
commit^

create domain CCSKUPINA varchar(50) default 'ALL' not null^
alter table TRASH add SKUPINA CCSKUPINA^
create index TRASH_PARAM on TRASH (SKUPINA, PKID)^
commit^

select*from TRASH A where A.SKUPINA='ALL'^

set term ;^

I should get all 5 rows, but I get nothing.

@firebird-automations
Copy link
Collaborator Author

Modified by: Přemysl Šťastný (stastnypremysl)

description: I had defined this table, which has a few row:
create table ODB_DOC_PRODUKTY_PARAMETRY (
PKID PKID,
PARAMETR PARAMETR,
HODNOTA TEXT5000_UTF,
ZAVISLOST_PARAMETR PARAMETR,
ZAVISLOST_HODNOTA TEXT5000_UTF,
EDITOVATELNOST LOGICAL3,
constraint ODB_DOC_PRODUKTY_PARAMETRY_PKID primary key (PKID))

I executed this script:
set term ^;
create domain DOCSKUPINA varchar(50) default 'ALL' not null^
alter table ODB_DOC_PRODUKTY_PARAMETRY add SKUPINA DOCSKUPINA^
create index ODB_DOC_SKUP_PARAM_PARAM on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, PARAMETR)^
create index ODB_DOC_SKUP_PARAM_ZAVISLOST on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, ZAVISLOST_PARAMETR)^
commit^
set term ;^

Now, when I try to:
select A.SKUPINA
from ODB_DOC_PRODUKTY_PARAMETRY A
where A.SKUPINA = 'ALL';

I get nothing.

When I
insert into ODB_DOC_PRODUKTY_PARAMETRY(PARAMETR) values ('para')

I get only the inserted row.

But when I deactivate indexes or
update ODB_DOC_PRODUKTY_PARAMETRY A
set A.SKUPINA = 'ALL';

I get all the rows.

=>

I had defined this table, which has a few row:
create table ODB_DOC_PRODUKTY_PARAMETRY (
PKID PKID,
PARAMETR PARAMETR,
HODNOTA TEXT5000_UTF,
ZAVISLOST_PARAMETR PARAMETR,
ZAVISLOST_HODNOTA TEXT5000_UTF,
EDITOVATELNOST LOGICAL3,
constraint ODB_DOC_PRODUKTY_PARAMETRY_PKID primary key (PKID))

I executed this script:
set term ^;
create domain DOCSKUPINA varchar(50) default 'ALL' not null^
alter table ODB_DOC_PRODUKTY_PARAMETRY add SKUPINA DOCSKUPINA^
create index ODB_DOC_SKUP_PARAM_PARAM on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, PARAMETR)^
create index ODB_DOC_SKUP_PARAM_ZAVISLOST on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, ZAVISLOST_PARAMETR)^
commit^
set term ;^

Now, when I try to:
select A.SKUPINA
from ODB_DOC_PRODUKTY_PARAMETRY A
where A.SKUPINA = 'ALL';

I get nothing.

When I
insert into ODB_DOC_PRODUKTY_PARAMETRY(PARAMETR) values ('para')

I get only the inserted row.

But when I deactivate indexes or
update ODB_DOC_PRODUKTY_PARAMETRY A
set A.SKUPINA = 'ALL';

I get all the rows.

_________________________________________________________________________________________
Better example:
set term ^;
create table TRASH (
PKID int
)^
commit^

insert into TRASH(PKID) values (1)^
insert into TRASH(PKID) values (2)^
insert into TRASH(PKID) values (3)^
insert into TRASH(PKID) values (4)^
insert into TRASH(PKID) values (5)^
commit^

create domain CCSKUPINA varchar(50) default 'ALL' not null^
alter table TRASH add SKUPINA CCSKUPINA^
create index TRASH_PARAM on TRASH (SKUPINA, PKID)^
commit^

select*from TRASH A where A.SKUPINA='ALL'^

set term ;^

@firebird-automations
Copy link
Collaborator Author

Modified by: Přemysl Šťastný (stastnypremysl)

description: I had defined this table, which has a few row:
create table ODB_DOC_PRODUKTY_PARAMETRY (
PKID PKID,
PARAMETR PARAMETR,
HODNOTA TEXT5000_UTF,
ZAVISLOST_PARAMETR PARAMETR,
ZAVISLOST_HODNOTA TEXT5000_UTF,
EDITOVATELNOST LOGICAL3,
constraint ODB_DOC_PRODUKTY_PARAMETRY_PKID primary key (PKID))

I executed this script:
set term ^;
create domain DOCSKUPINA varchar(50) default 'ALL' not null^
alter table ODB_DOC_PRODUKTY_PARAMETRY add SKUPINA DOCSKUPINA^
create index ODB_DOC_SKUP_PARAM_PARAM on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, PARAMETR)^
create index ODB_DOC_SKUP_PARAM_ZAVISLOST on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, ZAVISLOST_PARAMETR)^
commit^
set term ;^

Now, when I try to:
select A.SKUPINA
from ODB_DOC_PRODUKTY_PARAMETRY A
where A.SKUPINA = 'ALL';

I get nothing.

When I
insert into ODB_DOC_PRODUKTY_PARAMETRY(PARAMETR) values ('para')

I get only the inserted row.

But when I deactivate indexes or
update ODB_DOC_PRODUKTY_PARAMETRY A
set A.SKUPINA = 'ALL';

I get all the rows.

_________________________________________________________________________________________
Better example:
set term ^;
create table TRASH (
PKID int
)^
commit^

insert into TRASH(PKID) values (1)^
insert into TRASH(PKID) values (2)^
insert into TRASH(PKID) values (3)^
insert into TRASH(PKID) values (4)^
insert into TRASH(PKID) values (5)^
commit^

create domain CCSKUPINA varchar(50) default 'ALL' not null^
alter table TRASH add SKUPINA CCSKUPINA^
create index TRASH_PARAM on TRASH (SKUPINA, PKID)^
commit^

select*from TRASH A where A.SKUPINA='ALL'^

set term ;^

=>

I had defined this table, which has a few row:
create table ODB_DOC_PRODUKTY_PARAMETRY (
PKID PKID,
PARAMETR PARAMETR,
HODNOTA TEXT5000_UTF,
ZAVISLOST_PARAMETR PARAMETR,
ZAVISLOST_HODNOTA TEXT5000_UTF,
EDITOVATELNOST LOGICAL3,
constraint ODB_DOC_PRODUKTY_PARAMETRY_PKID primary key (PKID))

I executed this script:
set term ^;
create domain DOCSKUPINA varchar(50) default 'ALL' not null^
alter table ODB_DOC_PRODUKTY_PARAMETRY add SKUPINA DOCSKUPINA^
create index ODB_DOC_SKUP_PARAM_PARAM on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, PARAMETR)^
create index ODB_DOC_SKUP_PARAM_ZAVISLOST on ODB_DOC_PRODUKTY_PARAMETRY (SKUPINA, ZAVISLOST_PARAMETR)^
commit^
set term ;^

Now, when I try to:
select A.SKUPINA
from ODB_DOC_PRODUKTY_PARAMETRY A
where A.SKUPINA = 'ALL';

I get nothing.

When I
insert into ODB_DOC_PRODUKTY_PARAMETRY(PARAMETR) values ('para')

I get only the inserted row.

But when I deactivate indexes or
update ODB_DOC_PRODUKTY_PARAMETRY A
set A.SKUPINA = 'ALL';

I get all the rows.

_________________________________________________________________________________________
Better example:
set term ^;
create table TRASH (
PKID int
)^
commit^

insert into TRASH(PKID) values (1)^
insert into TRASH(PKID) values (2)^
insert into TRASH(PKID) values (3)^
insert into TRASH(PKID) values (4)^
insert into TRASH(PKID) values (5)^
commit^

create domain CCSKUPINA varchar(50) default 'ALL' not null^
alter table TRASH add SKUPINA CCSKUPINA^
create index TRASH_PARAM on TRASH (SKUPINA, PKID)^
commit^

select*from TRASH A where A.SKUPINA='ALL'^

set term ;^

I should get all 5 rows, but I get nothing.

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Please test FB 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant