On Tuesday, February 11, 2020 at 7:23:04 AM UTC-8, gencer wrote: > > Hi, > > SELECT "pg_attribute"."attname" AS "name", CAST("pg_attribute"."atttypid" > AS integer) AS "oid", CAST("basetype"."oid" AS integer) AS "base_oid", > format_type("basetype"."oid", "pg_type"."typtypmod") AS "db_base_type", > format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", > pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT > "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute". > "attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM > "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = > "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = > "pg_attribute"."atttypid") LEFT OUTER JOIN "pg_type" AS "basetype" ON ( > "basetype"."oid" = "pg_type"."typbasetype") LEFT OUTER JOIN "pg_attrdef" > ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" > = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index". > "indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) > WHERE (("pg_attribute"."attisdrop.................. > > On Rails, My logs full of this queries every single line of any sql action > performed. Almost 60% of my log pis full of this. > > Why Sequel produce this output and how to ignore them? I'm using > *SequelRails*. > > Hanami in the other hand does not have this issue. This also makes my > rails log very huge. I just cant track down anything else due to this > output. > > Also this happens on migrations too. When I ran migrations on Rails, i get > this output all the time. Not just once but after every line. > > Do you have any information on this, perhaps, how to prevent it and whats > the reason in the first place? >
Those are queries that Sequel uses to get metadata information from the database, such as table schema information. By default, Sequel logs queries at INFO level to all configured loggers. You can change this using DB.sql_log_level = :debug, where DB is your Sequel::Database instance. Normally, Sequel only needs get table schema information once per Sequel::Model class, so I'm not sure why you would be getting these queries continually after startup. If you can narrow this down to an issue in Sequel without the use of other libraries, you may want to post here to see if the behavior is expected or not. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to sequel-talk+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/83676244-d611-411b-9164-9f7f71bd9b1e%40googlegroups.com.