I want to do sharding in postgresql without using citus plugin.
can anybody suggest how to do ?
Postgresql 10 actually added support for native partitioning, but that was released less than a week ago. Have a look here for some examples of SQL syntax for usage:
https://postgrespro.co.il/blog/whats-new-in-postgresql-10-part-2-native-partitioning/
Related
I'm working with Firebird 2.5. I have used MySQL table partitioning in the past to help optimize very large tables by creating partitions based on year. I would like to do the same thing, if possible, in Firebird but I'm having trouble finding any documentation.
Does anyone know if this is possible and if so, can you please point me toward some documentation?
Firebird does not support table partitioning, which is also why you can't find anything about it in the documentation.
Depending on the exact performance problem you're trying to solve and the queries you use, choosing your indexes well may already solve part of the problem.
When I upgrade my database from PostgreSQL 9.6.5 to PostgreSQL 10.1 using pg_upgrade, some of my queries involving multiple tables suffer a massive performance degradation.
Running exactly the same query on exactly the same data with exactly the same indexes in 10.1 takes around 17 seconds compared to around 0.1 second in 9.6.
Looking at the EXPLAIN plan for the query, I can see that the plan between the two versions differs a lot - especially for a couple of sub-selects.
9.6 uses indexes a lot more than 10.1. 10.1 seems to favor full table scans over the indexes - even for tables with close to 1M records.
I have verified that the indexes haven't been "lost" during the upgrade. Also if I query the tables individually, the indexes are used.
Any insights?
Thanks,
Sebastian
Solved by doing pg_dump/pg_restore instead of pg_upgrade. Performance and query plans are back to normal.
The output of pg_upgrade includes this:
...
Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
./analyze_new_cluster.sh
...
We found horrible performance straight after the upgrade until we ran this, lesson learned to read the output :)
I need your advise please. I have an application that runs on PostgreSQL but takes too long to bring back data.
I would like to use Cassandra but noticed that CQL does not support aggregation.
Would that be possible with Hadoop or am I going completely the wrong way?
Also all the dates are stored in Epoch, and CQL can't convert them.
What would be the best approach to convert an application that runs on PostGreSQL to Cassandra?
Thank you for any suggestions.
Cassandra introduced aggregate functions in 2.2 with CASSANDRA-4914. The documentation for using the standard (built in) functions is here and for creating custom aggregate functions is here.
Consider long-running query in PostgreSQL of index creation, smth like that:
CREATE INDEX some_idx
ON some_table USING btree
(some_varchar_column COLLATE pg_catalog."default");
The question is: how to retrieve the progress of this query process? Is it possible or not?
It is interesting to know the way in both cases:
using pgAdmin
using SQL
using some internal postgreSQL tools.
May be this additional info could influence on the answer: PostgreSQL 9.3 on Windows 7 64 bit.
There's a wiki page on this very topic, which links to several links. Their accuracy is in question as of a few years ago. There's also a thread on hackers from 2006 or 2007 regarding adding progress indicators within which, EnterpriseDBs Greg Stark makes the same point.
In Postgres v12+ the view pg_stat_progress_create_index should give you this information.
https://www.postgresql.org/docs/12/progress-reporting.html
Does anyone know what substantial differences there are between the regular PostgreSQL and Postgres Plus?
The database is the same, meaning that the SQL is fully compatible to any other PostgreSQL installation around (save for the GIS data formats).
The main difference is that there is a bunch of modules and tools bundled with Postgres Plus that you would have to collect and install separately and by yourself otherwise. Thus the main advantage is easy and speedy installation.
Most of the bundled stuff looks like it's freely available from other sources. That Postgres Studio application looks suspiciously close to pgAdmin III.
One important difference is the licence:
Postgres Plus is only free for "non-production" use.
you can find detailed purchasing options here:
http://www.enterprisedb.com/products/purchase.do
Postgres PLUS is proprietary, PostgreSQL is Open source under permissive license (and that's why Postgres PLUS is proprietary).
Postgres PLUS has support for Oracle PL/SQL, while PostgreSQL does not, at least not officially.
Those are two most obvious differences.
I used 8.2 and when was the time to switch to 8.3 I tried PostGresPlus.
The Speed was a lot faster. LOT I mean queries that took 30 secs, takes now less than 2 seconds. I am not sure if it's 8.3 that is faster or the Enterprise Plus but I can tell you that I was impressed.
Other thing that I like is that I can debug proc stored. It cames with more tools.