Comments (3)
Well the real question here is why is loadStructure called many times. Because structure should be loaded once to cache and then cached structure should be used.
from database.
Also 50ms seems suspiciously high for simple query. I just checked and on my machine it took about 0.2-0.7ms (100 times less) for each structure query. Even on quite slow machines I would expect less that few ms per query. It seems to me that there might be some hidden problem with your database speed.
from database.
Yes, I should note (but I figured this out after posting the issue; sorry about that) that using a cache storage other than memory cache indeed solves the problem (I'm not sure if I can configure our server setup in any way so that the memory cache persists across different requests to the server, or if our PHP code will inevitably create a new, clean database instance without cache every time; but that's no longer an issue with Nette). A persistent cache does indeed solve this issue for us.
I think the 50ms delay occurs because our MySQL database is hosted in an Amazon AWS cluster, so there's probably a lot of latency from our local machines to it.
Still, if possible, I think it would be nice if this method could be implemented in a more efficient way (as I suggested, with a JOIN
, perhaps with some database-specific knowledge on which "magic tables" to look for, but I have not dug up Nette's code, so I don't even know if this is possible).
Thank you for the prompt response. I fully understand if this is considered to be a non-issue.
from database.
Related Issues (20)
- BC break in 3.1 handling "IN (?)" in query HOT 2
- Nette Query results in `string` instead of `array` for Postgres HOT 2
- TypeError Nette\Database\Table\Selection::count(): Return value must be of type int, string returned
- SQLiteDriver exception from getForeignKeys - incorrect results from PRAGMA foreign_key_list
- time datetype HOT 1
- When `count(column)` is used on selection `group` and `having` conditions are ignored HOT 2
- ActiveRow::accessColumn() returns INT value of column as a string HOT 5
- double fetch()ed as string
- Compatibility issue with Row vs IRow HOT 1
- whereOr adds IS NULL AND FALSE to the end of query when parameter is not associative array HOT 1
- Incomplete related data with StaticConventions HOT 1
- better support for BETWEEN clause
- Support short-time passwords (tokens) in connection strings HOT 2
- Union Selections
- Support for PostgreSQL own custom types?
- jetbrains/phpstorm-attributes dev-master vs 1.0 HOT 5
- Magic method __set return type of class ActiveRow is too strict HOT 1
- UPDATE Multiple rows doesn't work at all
- REPLACE AND INSERT ... ON DUPLICATE KEY UPDATE support in Explorer HOT 1
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 database.