Index statistics

37 views
Skip to first unread message

Tomasz Dubiel

unread,
Mar 11, 2026, 5:55:58 AM (10 days ago) Mar 11
to firebird-support
Hello.
Firebird 3.0.13. Why doesn't this work:
SET STATISTICS INDEX PK___EFMigrationsLock;
and this does work:
SET STATISTICS INDEX "PK___EFMigrationsLock";
First try gives:
ALTER INDEX PK___EFMIGRATIONSLOCK failed.
Index not found.
Best regards,
Tomek.

 

Dimitry Sibiryakov

unread,
Mar 11, 2026, 5:58:04 AM (10 days ago) Mar 11
to firebird...@googlegroups.com
Tomasz Dubiel wrote 11.03.2026 10:55:
> Firebird 3.0.13. Why doesn't this work:

Because the index was obviously created with delimited name.

https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref50/fblangref50-structure-identifiers.html#fblangref50-structure-identifiers-delim

--
WBR, SD.

Tomasz Dubiel

unread,
Mar 11, 2026, 6:02:12 AM (10 days ago) Mar 11
to firebird-support
Can you tell me more? What is the difference in usage between regular identifiers and delimited ones? Can I drop such one and create it as regular identifier?

Dimitry Sibiryakov

unread,
Mar 11, 2026, 6:03:33 AM (10 days ago) Mar 11
to firebird...@googlegroups.com
Tomasz Dubiel wrote 11.03.2026 11:02:
> Can you tell me more? What is the difference in usage between regular
> identifiers and delimited ones? Can I drop such one and create it as regular
> identifier?

I gave link to documentation where it is all described.

Repeat:
https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref50/fblangref50-structure-identifiers.html

--
WBR, SD.

Martijn Tonies (Upscene Productions)

unread,
Mar 11, 2026, 6:05:41 AM (10 days ago) Mar 11
to firebird-support
Hi,
 
Delimited identifiers are case sensitive, if they’re not uppercase only.
 
So:
 
“MYNAME” = myname, MyName, MYNAME, “MYNAME”
“MyName” = “MyName”, not myname, not MyName

Not delimited:
myname = myname, MyName, MYNAME, “MYNAME”
 
With regards,

Martijn Tonies
Upscene Productions
https://www.upscene.com

Database Workbench - developer tool for Oracle, SQL Server, PostgreSQL, MySQL, MariaDB, InterBase, SQLite, NexusDB and Firebird.
--
Support the ongoing development of Firebird! Consider donating to the Firebird Foundation and help ensure its future. Every contribution makes a difference. Learn more and donate here:
https://www.firebirdsql.org/donate
---
You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/firebird-support/1f24566a-f1cd-4f46-9ba9-86dfc16a8ae6n%40googlegroups.com.

Tomasz Dubiel

unread,
Mar 11, 2026, 6:17:22 AM (9 days ago) Mar 11
to firebird-support
Thanks.

Mark Rotteveel

unread,
Mar 11, 2026, 8:06:14 AM (9 days ago) Mar 11
to firebird...@googlegroups.com
On 11-03-2026 10:55, Tomasz Dubiel wrote:
> Firebird 3.0.13. Why doesn't this work:
> SET STATISTICS INDEX PK___EFMigrationsLock;
> and this does work:
> SET STATISTICS INDEX "PK___EFMigrationsLock";
> First try gives:
> ALTER INDEX PK___EFMIGRATIONSLOCK failed.
> Index not found.

The regular identifier PK___EFMigrationsLock is handled as the fully
uppercase equivalent PK___EFMIGRATIONSLOCK (i.e.
"PK___EFMIGRATIONSLOCK"), while the delimited identifier (or quoted
identifier) "PK___EFMigrationsLock" is used as-is.

Regular identifiers (unquoted identifiers) are said to be
case-insensitive, but that is a simplification of how it really works:
When a regular identifier is parsed, it is converted to its uppercase
equivalent. That uppercase equivalent is then used, which makes it
behave as if it's case-insensitive with respect to other regular
identifiers or delimited identifiers that are fully uppercase. It is not
equivalent to a delimited identifiers that contain any lowercase
equivalent character.

The identifier in your database is "PK___EFMigrationsLock", not
"PK___EFMIGRATIONSLOCK" (intentionally surrounding both with quotes
here), so the regular identifier PK___EFMigrationsLock does not match,
while the delimited identifier "PK___EFMigrationsLock" does.

Mark
--
Mark Rotteveel

Lester Caine

unread,
Mar 11, 2026, 10:32:52 AM (9 days ago) Mar 11
to firebird-support
Mark ... does the two double quotes take up two characters in the name? I've been trying to avoid the problem and am still working with 31 characters on the whole ;)

Mark Rotteveel

unread,
Mar 11, 2026, 11:10:38 AM (9 days ago) Mar 11
to firebird...@googlegroups.com
A regular identifier is stored in uppercase, and a delimited identifier
is stored as-is, without the quotes. So, no, those double quotes do not
take up any space (just like the single quotes around a string literal
are also not stored).

Also, the limit is 63 characters since Firebird 4.0.

Mark
--
Mark Rotteveel

Lester Caine

unread,
Mar 11, 2026, 12:12:18 PM (9 days ago) Mar 11
to firebird-support
A regular identifier is stored in uppercase, and a delimited identifier
is stored as-is, without the quotes. So, no, those double quotes do not
take up any space (just like the single quotes around a string literal
are also not stored). 
OK so when the schema is lower case without quotes it gets upper cased, while with quotes it does not and it's just processing the query that knows about 'case'. Just trying to tidy up my notes on the laravel/illuminate driver where I avoid double quotes but have to ensure that fields and tables are returned as lower case for compatibility with the rest of the code base. Mixed case just does not work ;)
 
Also, the limit is 63 characters since Firebird 4.0. 
Still looking to support Firebird 3 for the moment, but probably a little overkill since everything works simply by updating to FB5 and I've adopted the newer auto column anyway in the driver anyway.
Reply all
Reply to author
Forward
0 new messages