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

Interpretation of of FbDatabaseInfo values for BlackbirdSql SqlEditor port. #1157

Open
BlackbirdSQL opened this issue Jan 30, 2024 · 5 comments

Comments

@BlackbirdSQL
Copy link

Hi,
This is not an issue but not sure where else to ask this. Hope you can help.

I have been struggling to make sense of some of the values returned from FbDatabaseInfo which I am using in the BlackbirdSql DDEX extension's SqlEditor port.

  1. If you look at the snapshot trials the GetReadIdxCount() and GetReadSeqCount() values are returning huge numbers even after the cumulative values have been subtracted (see attached). Could you tell me what these values represent?
  2. GetReads() consistently returns zero. Am I missing a trick here?
  3. Is there some way of extracting the Server Execution Time of a query?

The extension is already released but I would like to jack up the stats reporting so that they're more useful.

Appreciate if you could help me out here. Thanks.
Greg

FirebirdSqlEditorStatistics

@cincuranet
Copy link
Member

1 & 2> Yeah. Looks like these methods are returning complete garbage. I guess, I'm parsing the response back incorrectly. I'll check and fix it.
3> I don't know from top of my head. But you can maybe check the isc_info_xxx or fb_info_xxx in Firebird sources whether something looks "suspicious". And if so, let me know and I'll add it.

@BlackbirdSQL
Copy link
Author

Thanks Jiri,

I have had a look through the isc codes but there's nothing that would return a server execution time. There was something elsewhere that returned a long that implied user server stats, and that I spent some time trying to decipher. Now I can't find it. I'll get back to you when I do.

Microsoft SqlServer does include "request cost" in it's SqlEditor stats. I see there is an isc code "isc_info_request_cost". It would be great if you could include that when you have some time.

Regards, Greg

@BlackbirdSQL
Copy link
Author

Okay so the majority of the isc codes return a struct with an array of value pairs. I am using Reflection atm to access the Version10.GdsDatabase::DatabaseInfo() method to get to the response buffer.
The structure of the buffer is as follows:

Byte 0 contains the isc code.

Bytes 1 and 2 contain the 16 bit UInt16 byte size of the value pairs array.

Following that is the value pairs array.

Each value pair consists of a 6 byte block as follows:
The first 2 bytes are the 16 bit UInt16 ID of the affected/applicable table.
The next 4 bytes are the 32 bit UInt32 value pertaining to the table for the isc code.

This means that the total number of value pairs is the byte size of the array / 6.

If you could expose the DatabaseInfo() method in FbDatabaseInfo with a public access modifier that would be helpful.

Cheers, Greg

@cincuranet
Copy link
Member

Instead of exposing GetDatabaseInfo (I assume you're really talking about this one) it makes more sense to me to have an implementation of that call and parsing/processing in FbDatabaseInfo . Feel free to create PR with the implementation.

@BlackbirdSQL
Copy link
Author

Yeah yeah that's what I meant.

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

2 participants