AFAIK, SQLite uses the same syntax as PostgreSQL but they are still different with different ways to use. I don't know (yet) how to apply that tech.amanjpro wrote: ↑Fri Dec 10, 2021 4:21 am Probably a sort of table sharding will also speedup querying. Postgres IIRC has partition by on relations, one can use that to make your queries faster
https://www.postgresql.org/docs/10/ddl- ... oning.html
Open Chess Game Database Standard
Moderator: Ras
-
- Posts: 1524
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: Open Chess Game Database Standard
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
The most features chess GUI, based on opensource Banksia - the chess tournament manager
-
- Posts: 883
- Joined: Sat Mar 13, 2021 1:47 am
- Full name: Amanj Sherwany
Re: Open Chess Game Database Standard
I am not sure if SQLite has a built-in feature for partitioning. But one can always do it manually. Say create a parent table that maps hashes that are between 0 to N-1, to table 1. N to 2N-1 to table 2 and etc.phhnguyen wrote: ↑Fri Dec 10, 2021 4:39 amAFAIK, SQLite uses the same syntax as PostgreSQL but they are still different with different ways to use. I don't know (yet) how to apply that tech.amanjpro wrote: ↑Fri Dec 10, 2021 4:21 am Probably a sort of table sharding will also speedup querying. Postgres IIRC has partition by on relations, one can use that to make your queries faster
https://www.postgresql.org/docs/10/ddl- ... oning.html
Your query might become two level, but you still might gain a lot of speed on average
-
- Posts: 1524
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: Open Chess Game Database Standard
Oh, I see. Good idea. Will try. Thanks.amanjpro wrote: ↑Fri Dec 10, 2021 5:08 amI am not sure if SQLite has a built-in feature for partitioning. But one can always do it manually. Say create a parent table that maps hashes that are between 0 to N-1, to table 1. N to 2N-1 to table 2 and etc.phhnguyen wrote: ↑Fri Dec 10, 2021 4:39 amAFAIK, SQLite uses the same syntax as PostgreSQL but they are still different with different ways to use. I don't know (yet) how to apply that tech.amanjpro wrote: ↑Fri Dec 10, 2021 4:21 am Probably a sort of table sharding will also speedup querying. Postgres IIRC has partition by on relations, one can use that to make your queries faster
https://www.postgresql.org/docs/10/ddl- ... oning.html
Your query might become two level, but you still might gain a lot of speed on average
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
The most features chess GUI, based on opensource Banksia - the chess tournament manager
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: Open Chess Game Database Standard
This wont help. The problem is just that the position X is there 1E6 Times splitting wont help and is against sql fundamentals. Keep it in one table. We have to live with that i guess because you can see that 50ms is acceptable after ply 5phhnguyen wrote: ↑Fri Dec 10, 2021 5:22 amOh, I see. Good idea. Will try. Thanks.amanjpro wrote: ↑Fri Dec 10, 2021 5:08 amI am not sure if SQLite has a built-in feature for partitioning. But one can always do it manually. Say create a parent table that maps hashes that are between 0 to N-1, to table 1. N to 2N-1 to table 2 and etc.phhnguyen wrote: ↑Fri Dec 10, 2021 4:39 amAFAIK, SQLite uses the same syntax as PostgreSQL but they are still different with different ways to use. I don't know (yet) how to apply that tech.amanjpro wrote: ↑Fri Dec 10, 2021 4:21 am Probably a sort of table sharding will also speedup querying. Postgres IIRC has partition by on relations, one can use that to make your queries faster
https://www.postgresql.org/docs/10/ddl- ... oning.html
Your query might become two level, but you still might gain a lot of speed on average
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: Open Chess Game Database Standard
Again the problem here is not that the hashes are not good but that we have so many duplicates like
01231
01231
01231
etc.. for 1e6 times.
If we limit to a single player or a group of players this problem goes away.
01231
01231
01231
etc.. for 1e6 times.
If we limit to a single player or a group of players this problem goes away.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer
-
- Posts: 391
- Joined: Tue Oct 08, 2019 11:39 pm
- Full name: Tomasz Sobczyk
Re: Open Chess Game Database Standard
who even needs millions of results, just slap LIMIT 100 on it and be done
dangi12012 wrote:No one wants to touch anything you have posted. That proves you now have negative reputations since everyone knows already you are a forum troll.
Maybe you copied your stockfish commits from someone else too?
I will look into that.
-
- Posts: 883
- Joined: Sat Mar 13, 2021 1:47 am
- Full name: Amanj Sherwany
Re: Open Chess Game Database Standard
Probably pagination instead of limit. But yeah limiting the resultset is the way to go
-
- Posts: 12777
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Open Chess Game Database Standard
Here are some fide games with the hash:
Some issues:
We do not need the Elo in both the header and the player table, that is redundant.
The hash is interpreted as a 4 byte integer by the SQLite ODBC driver, even though it is stored correctly. (I added an index on the hash).
It might help as a hint to the ODBC driver if the type of the hash were changed to:
BIGINT or INT8 or (better yet) UNSIGNED BIG INT
Some issues:
We do not need the Elo in both the header and the player table, that is redundant.
The hash is interpreted as a 4 byte integer by the SQLite ODBC driver, even though it is stored correctly. (I added an index on the hash).
It might help as a hint to the ODBC driver if the type of the hash were changed to:
BIGINT or INT8 or (better yet) UNSIGNED BIG INT
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 12777
- Joined: Wed Mar 08, 2006 8:57 pm
- Location: Redmond, WA USA
Re: Open Chess Game Database Standard
It would be nice to have a user defined function that can make the hash from a FEN/EPD.
That way we could do simple lookups like
SELECT gameid from hash where hash = makehash('rnbqkbnr/pppppppp/8/8/1P6/8/P1PPPPPP/RNBQKBNR b KQkq -')
That way we could do simple lookups like
SELECT gameid from hash where hash = makehash('rnbqkbnr/pppppppp/8/8/1P6/8/P1PPPPPP/RNBQKBNR b KQkq -')
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
-
- Posts: 1062
- Joined: Tue Apr 28, 2020 10:03 pm
- Full name: Daniel Infuehr
Re: Open Chess Game Database Standard
I can write you one this evening. will update you! - I need the Table to exist which the HashCode is calculated fromDann Corbit wrote: ↑Fri Dec 10, 2021 5:58 pm It would be nice to have a user defined function that can make the hash from a FEN/EPD.
That way we could do simple lookups like
SELECT gameid from hash where hash = makehash('rnbqkbnr/pppppppp/8/8/1P6/8/P1PPPPPP/RNBQKBNR b KQkq -')

Code: Select all
create table Zobrist(piece char, square integer, hash integer,
primary key (piece , square)
);
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
Daniel Inführ - Software Developer