Comments (3)
@Jacky56 You are doing everything right on the table definition and querying Piccolo. I think the problem is how asynpg
works with CockroachDB
. There have been several issues online based on this. I have Cockroach v22
on my local machine and I can't even insert data with arrays because the error is unable to decorate subquery
(which was resolved in v23
). Then I upgrade to the latest version available (v24.1.0
) and I get the same as you, a very slow query with a complex query in the cluster log. I don't think we can do anything in Piccolo, Based on this discussion the type introspection is done once and I can confirm that if we use a connection pool only the first query is slow and every other query is fine. psycopg
doesn't have those problems but Piccolo is based on asyncpg
from piccolo.
@sinisaos Thanks for looking into this. Hopefully asyncpg
will solve this problem in a future version. It's a good reason for us to consider supporting multiple Postgres client libraries. I'm going to try upgrading our CI to use Cockroach v24
.
from piccolo.
Another interesting note:
- swapping
Array(UUID())
toArray(Varchar())
would still run the complex query - swapping
Array(?)
toJSONB
would still run the complex query
from piccolo.
Related Issues (20)
- Fix `load_json` on joined tables
- Support arrays of timestamp / timestamptz / date / time in SQLite
- Upgrade CockroachDB
- Is there a way to truncate the table? HOT 3
- Add support for `CAST` to convert between types
- Add more operators to `QueryString`
- Add basic math functions
- Improve array serialisation in `get_sql_value`
- Replace deprecated `@abstractproperty`
- Add `not_any` method to `Array`
- Add `Concat` function
- Replace deprecated `startup` and `shutdown` events in asgi templates HOT 1
- Document how to achieve a `OneToOneField` in Piccolo
- Use `TableTest` to cut down boiler plate in tests
- Be able to hardcode migrations as fake
- Reverse relations fetching HOT 11
- Fix typo in `Email` docstring
- Improve `LazyTableReference`
- Add `Album` table to playground
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piccolo.