Oltre alla rimozione di alcune query specifiche di MySQL, la migrazione è stata abbastanza semplice. Il problema ora è che durante lo sviluppo ci sono molte più richieste al DB di prima.Passare da MySQL a Postgres su Rails 3
Started GET "/profiles/data" for 127.0.0.1 at Tue Sep 21 10:26:18 +0200 2010
Processing by ProfilesController#data as JSON
User Load (24.3ms) SELECT "users".* FROM "users" ORDER BY updated_at DESC LIMIT 1
CACHE (0.0ms) SELECT "users".* FROM "users" ORDER BY updated_at DESC LIMIT 1
SQL (10.5ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"users"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Ogni singola query risulta in 3-8 query aggiuntive come sopra. Cosa e perché sta succedendo? Uno dei problemi ora è che developement.log è gonfio e illeggibile. I rifiuti un sacco di tempo di scorrimento inbetween quei query che cercano la cosa giusta ...
Aggiornamento: mar 21
settembre Questo non è correlato al tipo di query. Tutte le query stanno generando questo tipo di stuph:
ree-1.8.7-2010.02 > User.first
SQL (0.3ms) SHOW client_min_messages
SQL (2.0ms) SET client_min_messages TO 'panic'
SQL (6.3ms) SET standard_conforming_strings = on
SQL (18.3ms) SET client_min_messages TO 'notice'
SQL (15.6ms) SET time zone 'UTC'
SQL (17.2ms) SHOW TIME ZONE
SQL (23.8ms) SELECT tablename FROM pg_tables WHERE schemaname = ANY (current_schemas(false))
User Load (162.4ms) SELECT "users".* FROM "users" LIMIT 1
SQL (7.5ms) SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc,
a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid
AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND
NOT a.attisdropped ORDER BY a.attnum
[...] 1 row in set ree-1.8.7-2010.02>
Invia la query che sta generando la dichiarazione. Probabilmente stai usando un codice orientato a MySQL. –
Non è il caso, spiegazione aggiunta alla domanda. – mdrozdziel