Compare commits

..

1 Commits

Author SHA1 Message Date
Farah Schüller
eb2a9b5f72 Add test for custom per-role healthchecks
This adds the test for checking whether custom healthcheck options
in the role context are actually accepted into configuration.
2023-11-20 16:15:44 +01:00
113 changed files with 1550 additions and 1803 deletions

View File

@@ -5,21 +5,6 @@ on:
- main
pull_request:
jobs:
rubocop:
name: RuboCop
runs-on: ubuntu-latest
env:
BUNDLE_ONLY: rubocop
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.0
bundler-cache: true
- name: Run Rubocop
run: bundle exec rubocop --parallel
tests:
strategy:
matrix:
@@ -27,29 +12,17 @@ jobs:
- "2.7"
- "3.1"
- "3.2"
- "3.3"
gemfile:
- Gemfile
- gemfiles/ruby_2.7.gemfile
- gemfiles/rails_edge.gemfile
exclude:
- ruby-version: "2.7"
gemfile: Gemfile
- ruby-version: "2.7"
gemfile: gemfiles/rails_edge.gemfile
- ruby-version: "3.1"
gemfile: gemfiles/ruby_2.7.gemfile
- ruby-version: "3.2"
gemfile: gemfiles/ruby_2.7.gemfile
- ruby-version: "3.3"
gemfile: gemfiles/ruby_2.7.gemfile
continue-on-error: [false]
name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }}
runs-on: ubuntu-latest
continue-on-error: true
continue-on-error: ${{ matrix.continue-on-error }}
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Install Ruby
uses: ruby/setup-ruby@v1

View File

@@ -1,2 +0,0 @@
inherit_gem:
rubocop-rails-omakase: rubocop.yml

View File

@@ -1,8 +1,4 @@
source "https://rubygems.org"
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gemspec
group :rubocop do
gem "rubocop-rails-omakase", require: false
end

View File

@@ -1,9 +1,8 @@
PATH
remote: .
specs:
kamal (1.5.0)
kamal (1.2.0)
activesupport (>= 7.0)
base64 (~> 0.2)
bcrypt_pbkdf (~> 1.0)
concurrent-ruby (~> 1.2)
dotenv (~> 2.8)
@@ -16,152 +15,82 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionpack (7.1.2)
actionview (= 7.1.2)
activesupport (= 7.1.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
actionpack (7.0.4.3)
actionview (= 7.0.4.3)
activesupport (= 7.0.4.3)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actionview (7.1.2)
activesupport (= 7.1.2)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.4.3)
activesupport (= 7.0.4.3)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activesupport (7.1.2)
base64
bigdecimal
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activesupport (7.0.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
ast (2.4.2)
base64 (0.2.0)
bcrypt_pbkdf (1.1.0)
bigdecimal (3.1.5)
builder (3.2.4)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
crass (1.0.6)
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
debug (1.7.2)
irb (>= 1.5.0)
reline (>= 0.3.1)
dotenv (2.8.1)
drb (2.2.0)
ruby2_keywords
ed25519 (1.3.0)
erubi (1.12.0)
i18n (1.14.1)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
io-console (0.7.1)
irb (1.11.0)
rdoc
reline (>= 0.3.8)
json (2.7.1)
language_server-protocol (3.17.0.3)
loofah (2.22.0)
io-console (0.6.0)
irb (1.6.3)
reline (>= 0.3.0)
loofah (2.20.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
minitest (5.20.0)
mocha (2.1.0)
nokogiri (>= 1.5.9)
method_source (1.0.0)
minitest (5.18.0)
mocha (2.0.2)
ruby2_keywords (>= 0.0.5)
mutex_m (0.2.0)
net-scp (4.0.0)
net-ssh (>= 2.6.5, < 8.0.0)
net-ssh (7.2.1)
nokogiri (1.16.0-arm64-darwin)
net-ssh (7.1.0)
nokogiri (1.14.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-darwin)
nokogiri (1.14.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
nokogiri (1.14.2-x86_64-linux)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.0.5)
ast (~> 2.4.1)
racc
psych (5.1.2)
stringio
racc (1.7.3)
rack (3.0.8)
rack-session (2.0.0)
rack (>= 3.0.0)
racc (1.6.2)
rack (2.2.6.4)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.2)
actionpack (= 7.1.2)
activesupport (= 7.1.2)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.1.0)
rdoc (6.6.2)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.4.2)
io-console (~> 0.5)
rexml (3.2.6)
rubocop (1.62.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-minitest (0.35.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-performance (1.20.2)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rails (2.24.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails-omakase (1.0.0)
rubocop
rubocop-minitest
rubocop-performance
rubocop-rails
ruby-progressbar (1.13.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
railties (7.0.4.3)
actionpack (= 7.0.4.3)
activesupport (= 7.0.4.3)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
reline (0.3.3)
io-console (~> 0.5)
ruby2_keywords (0.0.5)
sshkit (1.21.7)
mutex_m
sshkit (1.21.4)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
stringio (3.1.0)
thor (1.3.0)
thor (1.2.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webrick (1.8.1)
zeitwerk (2.6.12)
zeitwerk (2.6.7)
PLATFORMS
arm64-darwin
@@ -173,7 +102,6 @@ DEPENDENCIES
kamal!
mocha
railties
rubocop-rails-omakase
BUNDLED WITH
2.4.3

View File

@@ -1,6 +0,0 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gemspec path: "../"
gem "nokogiri", "~> 1.15.0"

View File

@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
spec.add_dependency "ed25519", "~> 1.2"
spec.add_dependency "bcrypt_pbkdf", "~> 1.0"
spec.add_dependency "concurrent-ruby", "~> 1.2"
spec.add_dependency "base64", "~> 0.2"
spec.add_development_dependency "debug"
spec.add_development_dependency "mocha"

View File

@@ -5,6 +5,6 @@ require "active_support"
require "zeitwerk"
loader = Zeitwerk::Loader.for_gem
loader.ignore(File.join(__dir__, "kamal", "sshkit_with_ext.rb"))
loader.ignore("#{__dir__}/kamal/sshkit_with_ext.rb")
loader.setup
loader.eager_load # We need all commands loaded.

View File

@@ -5,11 +5,11 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
if name == "all"
KAMAL.accessory_names.each { |accessory_name| boot(accessory_name) }
else
with_accessory(name) do |accessory, hosts|
with_accessory(name) do |accessory|
directories(name)
upload(name)
on(hosts) do
on(accessory.hosts) do
execute *KAMAL.registry.login if login
execute *KAMAL.auditor.record("Booted #{name} accessory"), verbosity: :debug
execute *accessory.run
@@ -22,8 +22,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "upload [NAME]", "Upload accessory files to host", hide: true
def upload(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
accessory.files.each do |(local, remote)|
accessory.ensure_local_file_present(local)
@@ -39,8 +39,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "directories [NAME]", "Create accessory directories on host", hide: true
def directories(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
accessory.directories.keys.each do |host_path|
execute *accessory.make_directory(host_path)
end
@@ -55,8 +55,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
if name == "all"
KAMAL.accessory_names.each { |accessory_name| reboot(accessory_name) }
else
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *KAMAL.registry.login
end
@@ -71,8 +71,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "start [NAME]", "Start existing accessory container on host"
def start(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *KAMAL.auditor.record("Started #{name} accessory"), verbosity: :debug
execute *accessory.start
end
@@ -83,8 +83,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "stop [NAME]", "Stop existing accessory container on host"
def stop(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *KAMAL.auditor.record("Stopped #{name} accessory"), verbosity: :debug
execute *accessory.stop, raise_on_non_zero_exit: false
end
@@ -107,8 +107,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
if name == "all"
KAMAL.accessory_names.each { |accessory_name| details(accessory_name) }
else
with_accessory(name) do |accessory, hosts|
on(hosts) { puts capture_with_info(*accessory.info) }
with_accessory(name) do |accessory|
on(accessory.hosts) { puts capture_with_info(*accessory.info) }
end
end
end
@@ -117,7 +117,7 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
option :interactive, aliases: "-i", type: :boolean, default: false, desc: "Execute command over ssh for an interactive shell (use for console/bash)"
option :reuse, type: :boolean, default: false, desc: "Reuse currently running container instead of starting a new one"
def exec(name, cmd)
with_accessory(name) do |accessory, hosts|
with_accessory(name) do |accessory|
case
when options[:interactive] && options[:reuse]
say "Launching interactive command with via SSH from existing container...", :magenta
@@ -129,14 +129,14 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
when options[:reuse]
say "Launching command from existing container...", :magenta
on(hosts) do
on(accessory.hosts) do
execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on #{name} accessory"), verbosity: :debug
capture_with_info(*accessory.execute_in_existing_container(cmd))
end
else
say "Launching command from new container...", :magenta
on(hosts) do
on(accessory.hosts) do
execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on #{name} accessory"), verbosity: :debug
capture_with_info(*accessory.execute_in_new_container(cmd))
end
@@ -150,12 +150,12 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
option :grep, aliases: "-g", desc: "Show lines with grep match only (use this to fetch specific requests by id)"
option :follow, aliases: "-f", desc: "Follow logs on primary server (or specific host set by --hosts)"
def logs(name)
with_accessory(name) do |accessory, hosts|
with_accessory(name) do |accessory|
grep = options[:grep]
if options[:follow]
run_locally do
info "Following logs on #{hosts}..."
info "Following logs on #{accessory.hosts}..."
info accessory.follow_logs(grep: grep)
exec accessory.follow_logs(grep: grep)
end
@@ -163,7 +163,7 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
since = options[:since]
lines = options[:lines].presence || ((since || grep) ? nil : 100) # Default to 100 lines if since or grep isn't set
on(hosts) do
on(accessory.hosts) do
puts capture_with_info(*accessory.logs(since: since, lines: lines, grep: grep))
end
end
@@ -177,7 +177,7 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
if name == "all"
KAMAL.accessory_names.each { |accessory_name| remove(accessory_name) }
else
confirming "This will remove all containers, images and data directories for #{name}. Are you sure?" do
if options[:confirmed] || ask("This will remove all containers, images and data directories for #{name}. Are you sure?", limited_to: %w( y N ), default: "N") == "y"
with_accessory(name) do
stop(name)
remove_container(name)
@@ -192,8 +192,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "remove_container [NAME]", "Remove accessory container from host", hide: true
def remove_container(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *KAMAL.auditor.record("Remove #{name} accessory container"), verbosity: :debug
execute *accessory.remove_container
end
@@ -204,8 +204,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "remove_image [NAME]", "Remove accessory image from host", hide: true
def remove_image(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *KAMAL.auditor.record("Removed #{name} accessory image"), verbosity: :debug
execute *accessory.remove_image
end
@@ -216,8 +216,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
desc "remove_service_directory [NAME]", "Remove accessory directory used for uploaded files and data directories from host", hide: true
def remove_service_directory(name)
mutating do
with_accessory(name) do |accessory, hosts|
on(hosts) do
with_accessory(name) do |accessory|
on(accessory.hosts) do
execute *accessory.remove_service_directory
end
end
@@ -226,9 +226,8 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
private
def with_accessory(name)
if KAMAL.config.accessory(name)
accessory = KAMAL.accessory(name)
yield accessory, accessory_hosts(accessory)
if accessory = KAMAL.accessory(name)
yield accessory
else
error_on_missing_accessory(name)
end
@@ -241,12 +240,4 @@ class Kamal::Cli::Accessory < Kamal::Cli::Base
"No accessory by the name of '#{name}'" +
(options ? " (options: #{options.to_sentence})" : "")
end
def accessory_hosts(accessory)
if KAMAL.specific_hosts&.any?
KAMAL.specific_hosts & accessory.hosts
else
accessory.hosts
end
end
end

View File

@@ -7,22 +7,59 @@ class Kamal::Cli::App < Kamal::Cli::Base
using_version(version_or_latest) do |version|
say "Start container with version #{version} using a #{KAMAL.config.readiness_delay}s readiness delay (or reboot if already running)...", :magenta
# Assets are prepared in a separate step to ensure they are on all hosts before booting
on(KAMAL.hosts) do
execute *KAMAL.auditor.record("Tagging #{KAMAL.config.absolute_image} as the latest image"), verbosity: :debug
execute *KAMAL.app.tag_current_image_as_latest
KAMAL.roles_on(host).each do |role|
Kamal::Cli::App::PrepareAssets.new(host, role, self).run
app = KAMAL.app(role: role)
role_config = KAMAL.config.role(role)
if role_config.assets?
execute *app.extract_assets
old_version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
execute *app.sync_asset_volumes(old_version: old_version)
end
end
end
on(KAMAL.hosts, **KAMAL.boot_strategy) do |host|
KAMAL.roles_on(host).each do |role|
Kamal::Cli::App::Boot.new(host, role, version, self).run
app = KAMAL.app(role: role)
auditor = KAMAL.auditor(role: role)
role_config = KAMAL.config.role(role)
if capture_with_info(*app.container_id_for_version(version), raise_on_non_zero_exit: false).present?
tmp_version = "#{version}_replaced_#{SecureRandom.hex(8)}"
info "Renaming container #{version} to #{tmp_version} as already deployed on #{host}"
execute *auditor.record("Renaming container #{version} to #{tmp_version}"), verbosity: :debug
execute *app.rename_container(version: version, new_version: tmp_version)
end
old_version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
execute *app.tie_cord(role_config.cord_host_file) if role_config.uses_cord?
execute *auditor.record("Booted app version #{version}"), verbosity: :debug
execute *app.run(hostname: "#{host}-#{SecureRandom.hex(6)}")
Kamal::Cli::Healthcheck::Poller.wait_for_healthy(pause_after_ready: true) { capture_with_info(*app.status(version: version)) }
if old_version.present?
if role_config.uses_cord?
cord = capture_with_info(*app.cord(version: old_version), raise_on_non_zero_exit: false).strip
if cord.present?
execute *app.cut_cord(cord)
Kamal::Cli::Healthcheck::Poller.wait_for_unhealthy(pause_after_ready: true) { capture_with_info(*app.status(version: old_version)) }
end
end
on(KAMAL.hosts) do |host|
execute *KAMAL.auditor.record("Tagging #{KAMAL.config.absolute_image} as the latest image"), verbosity: :debug
execute *KAMAL.app.tag_latest_image
execute *app.stop(version: old_version), raise_on_non_zero_exit: false
execute *app.clean_up_assets if role_config.assets?
end
end
end
end
end
@@ -72,15 +109,13 @@ class Kamal::Cli::App < Kamal::Cli::Base
desc "exec [CMD]", "Execute a custom command on servers (use --help to show options)"
option :interactive, aliases: "-i", type: :boolean, default: false, desc: "Execute command over ssh for an interactive shell (use for console/bash)"
option :reuse, type: :boolean, default: false, desc: "Reuse currently running container instead of starting a new one"
option :env, aliases: "-e", type: :hash, desc: "Set environment variables for the command"
def exec(cmd)
env = options[:env]
case
when options[:interactive] && options[:reuse]
say "Get current version of running container...", :magenta unless options[:version]
using_version(options[:version] || current_running_version) do |version|
say "Launching interactive command with version #{version} via SSH from existing container on #{KAMAL.primary_host}...", :magenta
run_locally { exec KAMAL.app(role: KAMAL.primary_role).execute_in_existing_container_over_ssh(cmd, host: KAMAL.primary_host, env: env) }
run_locally { exec KAMAL.app(role: KAMAL.primary_role).execute_in_existing_container_over_ssh(cmd, host: KAMAL.primary_host) }
end
when options[:interactive]
@@ -88,7 +123,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
using_version(version_or_latest) do |version|
say "Launching interactive command with version #{version} via SSH from new container on #{KAMAL.primary_host}...", :magenta
run_locally do
exec KAMAL.app(role: KAMAL.primary_role).execute_in_new_container_over_ssh(cmd, host: KAMAL.primary_host, env: env)
exec KAMAL.app(role: KAMAL.primary_role).execute_in_new_container_over_ssh(cmd, host: KAMAL.primary_host)
end
end
@@ -102,7 +137,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
roles.each do |role|
execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on app version #{version}", role: role), verbosity: :debug
puts_by_host host, capture_with_info(*KAMAL.app(role: role).execute_in_existing_container(cmd, env: env))
puts_by_host host, capture_with_info(*KAMAL.app(role: role).execute_in_existing_container(cmd))
end
end
end
@@ -116,7 +151,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
roles.each do |role|
execute *KAMAL.auditor.record("Executed cmd '#{cmd}' on app version #{version}"), verbosity: :debug
puts_by_host host, capture_with_info(*KAMAL.app(role: role).execute_in_new_container(cmd, env: env))
puts_by_host host, capture_with_info(*KAMAL.app(role: role).execute_in_new_container(cmd))
end
end
end
@@ -140,10 +175,7 @@ class Kamal::Cli::App < Kamal::Cli::Base
roles = KAMAL.roles_on(host)
roles.each do |role|
versions = capture_with_info(*KAMAL.app(role: role).list_versions, raise_on_non_zero_exit: false).split("\n")
versions -= [ capture_with_info(*KAMAL.app(role: role).current_running_version, raise_on_non_zero_exit: false).strip ]
versions.each do |version|
cli.send(:stale_versions, host: host, role: role).each do |version|
if stop
puts_by_host host, "Stopping stale container for role #{role} with version #{version}"
execute *KAMAL.app(role: role).stop(version: version), raise_on_non_zero_exit: false
@@ -170,20 +202,19 @@ class Kamal::Cli::App < Kamal::Cli::Base
# FIXME: Catch when app containers aren't running
grep = options[:grep]
since = options[:since]
if options[:follow]
lines = options[:lines].presence || ((since || grep) ? nil : 10) # Default to 10 lines if since or grep isn't set
if options[:follow]
run_locally do
info "Following logs on #{KAMAL.primary_host}..."
KAMAL.specific_roles ||= ["web"]
role = KAMAL.roles_on(KAMAL.primary_host).first
info KAMAL.app(role: role).follow_logs(host: KAMAL.primary_host, lines: lines, grep: grep)
exec KAMAL.app(role: role).follow_logs(host: KAMAL.primary_host, lines: lines, grep: grep)
info KAMAL.app(role: role).follow_logs(host: KAMAL.primary_host, grep: grep)
exec KAMAL.app(role: role).follow_logs(host: KAMAL.primary_host, grep: grep)
end
else
since = options[:since]
lines = options[:lines].presence || ((since || grep) ? nil : 100) # Default to 100 lines if since or grep isn't set
on(KAMAL.hosts) do |host|
@@ -279,7 +310,18 @@ class Kamal::Cli::App < Kamal::Cli::Base
version.presence
end
def stale_versions(host:, role:)
versions = nil
on(host) do
versions = \
capture_with_info(*KAMAL.app(role: role).list_versions, raise_on_non_zero_exit: false)
.split("\n")
.drop(1)
end
versions
end
def version_or_latest
options[:version] || KAMAL.config.latest_tag
options[:version] || "latest"
end
end

View File

@@ -1,73 +0,0 @@
class Kamal::Cli::App::Boot
attr_reader :host, :role, :version, :sshkit
delegate :execute, :capture_with_info, :info, to: :sshkit
delegate :uses_cord?, :assets?, to: :role
def initialize(host, role, version, sshkit)
@host = host
@role = role
@version = version
@sshkit = sshkit
end
def run
old_version, old_app = old_version_renamed_if_clashing
start_new_version
if old_version
stop_old_version(old_version, old_app)
end
end
private
def app
@app ||= KAMAL.app(role: role)
end
def auditor
@auditor = KAMAL.auditor(role: role)
end
def audit(message)
execute *auditor.record(message), verbosity: :debug
end
def old_version_renamed_if_clashing
if capture_with_info(*app.container_id_for_version(version), raise_on_non_zero_exit: false).present?
renamed_version = "#{version}_replaced_#{SecureRandom.hex(8)}"
info "Renaming container #{version} to #{renamed_version} as already deployed on #{host}"
audit("Renaming container #{version} to #{renamed_version}")
execute *app.rename_container(version: version, new_version: renamed_version)
end
[ role, *role.previous_roles ].each do |old_role|
old_app = KAMAL.app(role: old_role)
old_version = capture_with_info(*old_app.current_running_version, raise_on_non_zero_exit: false).strip.presence
return [ old_version, old_app ] if old_version
end
nil
end
def start_new_version
audit "Booted app version #{version}"
execute *app.tie_cord(role.cord_host_file) if uses_cord?
execute *app.run(hostname: "#{host}-#{SecureRandom.hex(6)}")
Kamal::Cli::Healthcheck::Poller.wait_for_healthy(pause_after_ready: true) { capture_with_info(*app.status(version: version)) }
end
def stop_old_version(version, app)
if uses_cord?
cord = capture_with_info(*app.cord(version: version), raise_on_non_zero_exit: false).strip
if cord.present?
execute *app.cut_cord(cord)
Kamal::Cli::Healthcheck::Poller.wait_for_unhealthy(pause_after_ready: true) { capture_with_info(*app.status(version: version)) }
end
end
execute *app.stop(version: version), raise_on_non_zero_exit: false
execute *app.clean_up_assets if assets?
end
end

View File

@@ -1,24 +0,0 @@
class Kamal::Cli::App::PrepareAssets
attr_reader :host, :role, :sshkit
delegate :execute, :capture_with_info, :info, to: :sshkit
delegate :assets?, to: :role
def initialize(host, role, sshkit)
@host = host
@role = role
@sshkit = sshkit
end
def run
if assets?
execute *app.extract_assets
old_version = capture_with_info(*app.current_running_version, raise_on_non_zero_exit: false).strip
execute *app.sync_asset_volumes(old_version: old_version)
end
end
private
def app
@app ||= KAMAL.app(role: role)
end
end

View File

@@ -73,7 +73,7 @@ module Kamal::Cli
def print_runtime
started_at = Time.now
yield
Time.now - started_at
return Time.now - started_at
ensure
runtime = Time.now - started_at
puts " Finished all in #{sprintf("%.1f seconds", runtime)}"
@@ -84,7 +84,7 @@ module Kamal::Cli
run_hook "pre-connect"
ensure_run_and_locks_directory
ensure_run_directory
acquire_lock
@@ -103,16 +103,6 @@ module Kamal::Cli
release_lock
end
def confirming(question)
return yield if options[:confirmed]
if ask(question, limited_to: %w[ y N ], default: "N") == "y"
yield
else
say "Aborted", :red
end
end
def acquire_lock
raise_if_locked do
say "Acquiring the deploy lock...", :magenta
@@ -133,9 +123,8 @@ module Kamal::Cli
yield
rescue SSHKit::Runner::ExecuteError => e
if e.message =~ /cannot create directory/
say "Deploy lock already in place!", :red
on(KAMAL.primary_host) { puts capture_with_debug(*KAMAL.lock.status) }
raise LockError, "Deploy lock found. Run 'kamal lock help' for more information"
raise LockError, "Deploy lock found"
else
raise e
end
@@ -157,9 +146,9 @@ module Kamal::Cli
say "Running the #{hook} hook...", :magenta
run_locally do
execute *KAMAL.hook.run(hook, **details, **extra_details)
rescue SSHKit::Command::Failed => e
raise HookError.new("Hook `#{hook}` failed:\n#{e.message}")
KAMAL.with_verbosity(:debug) { execute *KAMAL.hook.run(hook, **details, **extra_details) }
rescue SSHKit::Command::Failed
raise HookError.new("Hook `#{hook}` failed")
end
end
end
@@ -186,14 +175,10 @@ module Kamal::Cli
instance_variable_get("@_invocations").first
end
def ensure_run_and_locks_directory
def ensure_run_directory
on(KAMAL.hosts) do
execute(*KAMAL.server.ensure_run_directory)
end
on(KAMAL.primary_host) do
execute(*KAMAL.lock.ensure_locks_directory)
end
end
end
end

View File

@@ -8,21 +8,22 @@ class Kamal::Cli::Env < Kamal::Cli::Base
execute *KAMAL.auditor.record("Pushed env files"), verbosity: :debug
KAMAL.roles_on(host).each do |role|
role_config = KAMAL.config.role(role)
execute *KAMAL.app(role: role).make_env_directory
upload! role.env.secrets_io, role.env.secrets_file, mode: 400
upload! StringIO.new(role_config.env_file), role_config.host_env_file_path, mode: 400
end
end
on(KAMAL.traefik_hosts) do
execute *KAMAL.traefik.make_env_directory
upload! KAMAL.traefik.env.secrets_io, KAMAL.traefik.env.secrets_file, mode: 400
upload! StringIO.new(KAMAL.traefik.env_file), KAMAL.traefik.host_env_file_path, mode: 400
end
on(KAMAL.accessory_hosts) do
KAMAL.accessories_on(host).each do |accessory|
accessory_config = KAMAL.config.accessory(accessory)
execute *KAMAL.accessory(accessory).make_env_directory
upload! accessory_config.env.secrets_io, accessory_config.env.secrets_file, mode: 400
upload! StringIO.new(accessory_config.env_file), accessory_config.host_env_file_path, mode: 400
end
end
end
@@ -35,6 +36,7 @@ class Kamal::Cli::Env < Kamal::Cli::Base
execute *KAMAL.auditor.record("Deleted env files"), verbosity: :debug
KAMAL.roles_on(host).each do |role|
role_config = KAMAL.config.role(role)
execute *KAMAL.app(role: role).remove_env_file
end
end

View File

@@ -1,18 +1,15 @@
class Kamal::Cli::Main < Kamal::Cli::Base
desc "setup", "Setup all accessories, push the env, and deploy app to servers"
option :skip_push, aliases: "-P", type: :boolean, default: false, desc: "Skip image build and push"
def setup
print_runtime do
mutating do
invoke_options = deploy_options
say "Ensure Docker is installed...", :magenta
invoke "kamal:cli:server:bootstrap", [], invoke_options
invoke "kamal:cli:server:bootstrap"
say "Push env files...", :magenta
invoke "kamal:cli:env:push", [], invoke_options
invoke "kamal:cli:env:push"
invoke "kamal:cli:accessory:boot", [ "all" ], invoke_options
invoke "kamal:cli:accessory:boot", [ "all" ]
deploy
end
end
@@ -197,7 +194,7 @@ class Kamal::Cli::Main < Kamal::Cli::Base
option :confirmed, aliases: "-y", type: :boolean, default: false, desc: "Proceed without confirmation question"
def remove
mutating do
confirming "This will remove all containers and images. Are you sure?" do
if options[:confirmed] || ask("This will remove all containers and images. Are you sure?", limited_to: %w( y N ), default: "N") == "y"
invoke "kamal:cli:traefik:remove", [], options.without(:confirmed)
invoke "kamal:cli:app:remove", [], options.without(:confirmed)
invoke "kamal:cli:accessory:remove", [ "all" ], options

View File

@@ -18,16 +18,12 @@ class Kamal::Cli::Prune < Kamal::Cli::Base
end
end
desc "containers", "Prune all stopped containers, except the last n (default 5)"
option :retain, type: :numeric, default: nil, desc: "Number of containers to retain"
desc "containers", "Prune all stopped containers, except the last 5"
def containers
retain = options.fetch(:retain, KAMAL.config.retain_containers)
raise "retain must be at least 1" if retain < 1
mutating do
on(KAMAL.hosts) do
execute *KAMAL.auditor.record("Pruned containers"), verbosity: :debug
execute *KAMAL.prune.app_containers(retain: retain)
execute *KAMAL.prune.app_containers
execute *KAMAL.prune.healthcheck_containers
end
end

View File

@@ -17,9 +17,7 @@ class Kamal::Cli::Server < Kamal::Cli::Base
end
if missing.any?
raise "Docker is not installed on #{missing.join(", ")} and can't be automatically installed without having root access and either `wget` or `curl`. Install Docker manually: https://docs.docker.com/engine/install/"
end
run_hook "docker-setup"
raise "Docker is not installed on #{missing.join(", ")} and can't be automatically installed without having root access and the `curl` command available. Install Docker manually: https://docs.docker.com/engine/install/"
end
end
end

View File

@@ -63,7 +63,7 @@ registry:
# directories:
# - data:/data
# Configure custom arguments for Traefik. Be sure to reboot traefik when you modify it.
# Configure custom arguments for Traefik
# traefik:
# args:
# accesslog: true
@@ -77,10 +77,6 @@ registry:
# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
# hitting 404 on in-flight requests. Combines all files from new and old
# version inside the asset_path.
#
# If your app is using the Sprockets gem, ensure it sets `config.assets.manifest`.
# See https://github.com/basecamp/kamal/issues/626 for details
#
# asset_path: /rails/public/assets
# Configure rolling deploys by setting a wait time between batches of restarts.

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env ruby
# A sample docker-setup hook
#
# Sets up a Docker network which can then be used by the applications containers
ssh user@example.com docker network create kamal

View File

@@ -11,9 +11,7 @@ class Kamal::Cli::Traefik < Kamal::Cli::Base
desc "reboot", "Reboot Traefik on servers (stop container, remove container, start new container)"
option :rolling, type: :boolean, default: false, desc: "Reboot traefik on hosts in sequence, rather than in parallel"
option :confirmed, aliases: "-y", type: :boolean, default: false, desc: "Proceed without confirmation question"
def reboot
confirming "This will cause a brief outage on each host. Are you sure?" do
mutating do
host_groups = options[:rolling] ? KAMAL.traefik_hosts : [KAMAL.traefik_hosts]
host_groups.each do |hosts|
@@ -22,7 +20,7 @@ class Kamal::Cli::Traefik < Kamal::Cli::Base
on(hosts) do
execute *KAMAL.auditor.record("Rebooted traefik"), verbosity: :debug
execute *KAMAL.registry.login
execute *KAMAL.traefik.stop, raise_on_non_zero_exit: false
execute *KAMAL.traefik.stop
execute *KAMAL.traefik.remove_container
execute *KAMAL.traefik.run
end
@@ -30,7 +28,6 @@ class Kamal::Cli::Traefik < Kamal::Cli::Base
end
end
end
end
desc "start", "Start existing Traefik container on servers"
def start
@@ -47,7 +44,7 @@ class Kamal::Cli::Traefik < Kamal::Cli::Base
mutating do
on(KAMAL.traefik_hosts) do
execute *KAMAL.auditor.record("Stopped traefik"), verbosity: :debug
execute *KAMAL.traefik.stop, raise_on_non_zero_exit: false
execute *KAMAL.traefik.stop
end
end
end

View File

@@ -3,13 +3,11 @@ require "active_support/core_ext/module/delegation"
class Kamal::Commander
attr_accessor :verbosity, :holding_lock, :hold_lock_on_error
delegate :hosts, :roles, :primary_host, :primary_role, :roles_on, :traefik_hosts, :accessory_hosts, to: :specifics
def initialize
self.verbosity = :info
self.holding_lock = false
self.hold_lock_on_error = false
@specifics = nil
end
def config
@@ -26,34 +24,47 @@ class Kamal::Commander
attr_reader :specific_roles, :specific_hosts
def specific_primary!
@specifics = nil
self.specific_hosts = [ config.primary_host ]
end
def specific_roles=(role_names)
@specifics = nil
if role_names.present?
@specific_roles = Kamal::Utils.filter_specific_items(role_names, config.roles)
if @specific_roles.empty?
raise ArgumentError, "No --roles match for #{role_names.join(',')}"
end
@specific_roles
end
@specific_roles = Kamal::Utils.filter_specific_items(role_names, config.roles) if role_names.present?
end
def specific_hosts=(hosts)
@specifics = nil
if hosts.present?
@specific_hosts = Kamal::Utils.filter_specific_items(hosts, config.all_hosts)
if @specific_hosts.empty?
raise ArgumentError, "No --hosts match for #{hosts.join(',')}"
@specific_hosts = Kamal::Utils.filter_specific_items(hosts, config.all_hosts) if hosts.present?
end
@specific_hosts
def primary_host
specific_hosts&.first || specific_roles&.first&.primary_host || config.primary_host
end
def primary_role
roles_on(primary_host).first
end
def roles
(specific_roles || config.roles).select do |role|
((specific_hosts || config.all_hosts) & role.hosts).any?
end
end
def hosts
(specific_hosts || config.all_hosts).select do |host|
(specific_roles || config.roles).flat_map(&:hosts).include?(host)
end
end
def roles_on(host)
roles.select { |role| role.hosts.include?(host.to_s) }.map(&:name)
end
def traefik_hosts
specific_hosts || config.traefik_hosts
end
def accessory_hosts
specific_hosts || config.accessories.flat_map(&:hosts)
end
def accessory_names
@@ -153,8 +164,4 @@ class Kamal::Commander
SSHKit.config.command_map[:docker] = "docker" # No need to use /usr/bin/env, just clogs up the logs
SSHKit.config.output_verbosity = verbosity
end
def specifics
@specifics ||= Kamal::Commander::Specifics.new(config, specific_hosts, specific_roles)
end
end

View File

@@ -1,49 +0,0 @@
class Kamal::Commander::Specifics
attr_reader :primary_host, :primary_role, :hosts, :roles
delegate :stable_sort!, to: Kamal::Utils
def initialize(config, specific_hosts, specific_roles)
@config, @specific_hosts, @specific_roles = config, specific_hosts, specific_roles
@roles, @hosts = specified_roles, specified_hosts
@primary_host = specific_hosts&.first || primary_specific_role&.primary_host || config.primary_host
@primary_role = primary_or_first_role(roles_on(primary_host))
stable_sort!(roles) { |role| role == primary_role ? 0 : 1 }
stable_sort!(hosts) { |host| roles_on(host).any? { |role| role == primary_role } ? 0 : 1 }
end
def roles_on(host)
roles.select { |role| role.hosts.include?(host.to_s) }
end
def traefik_hosts
specific_hosts || config.traefik_hosts
end
def accessory_hosts
specific_hosts || config.accessories.flat_map(&:hosts)
end
private
attr_reader :config, :specific_hosts, :specific_roles
def primary_specific_role
primary_or_first_role(specific_roles) if specific_roles.present?
end
def primary_or_first_role(roles)
roles.detect { |role| role == config.primary_role } || roles.first
end
def specified_roles
(specific_roles || config.roles) \
.select { |role| ((specific_hosts || config.all_hosts) & role.hosts).any? }
end
def specified_hosts
(specific_hosts || config.all_hosts) \
.select { |host| (specific_roles || config.roles).flat_map(&:hosts).include?(host) }
end
end

View File

@@ -99,11 +99,11 @@ class Kamal::Commands::Accessory < Kamal::Commands::Base
end
def make_env_directory
make_directory accessory_config.env.secrets_directory
make_directory accessory_config.host_env_directory
end
def remove_env_file
[ :rm, "-f", accessory_config.env.secrets_file ]
[:rm, "-f", accessory_config.host_env_file_path]
end
private

View File

@@ -3,11 +3,12 @@ class Kamal::Commands::App < Kamal::Commands::Base
ACTIVE_DOCKER_STATUSES = [ :running, :restarting ]
attr_reader :role
attr_reader :role, :role_config
def initialize(config, role: nil)
super(config)
@role = role
@role_config = config.role(self.role)
end
def run(hostname: nil)
@@ -18,15 +19,15 @@ class Kamal::Commands::App < Kamal::Commands::Base
*(["--hostname", hostname] if hostname),
"-e", "KAMAL_CONTAINER_NAME=\"#{container_name}\"",
"-e", "KAMAL_VERSION=\"#{config.version}\"",
*role.env_args,
*role.health_check_args,
*role.logging_args,
*role_config.env_args,
*role_config.health_check_args,
*config.logging_args,
*config.volume_args,
*role.asset_volume_args,
*role.label_args,
*role.option_args,
*role_config.asset_volume_args,
*role_config.label_args,
*role_config.option_args,
config.absolute_image,
role.cmd
role_config.cmd
end
def start
@@ -49,7 +50,7 @@ class Kamal::Commands::App < Kamal::Commands::Base
def current_running_container_id
current_running_container(format: "--quiet")
docker :ps, "--quiet", *filter_args(statuses: ACTIVE_DOCKER_STATUSES), "--latest"
end
def container_id_for_version(version, only_running: false)
@@ -57,57 +58,36 @@ class Kamal::Commands::App < Kamal::Commands::Base
end
def current_running_version
pipe \
current_running_container(format: "--format '{{.Names}}'"),
extract_version_from_name
list_versions("--latest", statuses: ACTIVE_DOCKER_STATUSES)
end
def list_versions(*docker_args, statuses: nil)
pipe \
docker(:ps, *filter_args(statuses: statuses), *docker_args, "--format", '"{{.Names}}"'),
extract_version_from_name
%(while read line; do echo ${line##{role_config.container_prefix}-}; done) # Extract SHA from "service-role-dest-SHA"
end
def make_env_directory
make_directory role.env.secrets_directory
make_directory role_config.host_env_directory
end
def remove_env_file
[ :rm, "-f", role.env.secrets_file ]
[ :rm, "-f", role_config.host_env_file_path ]
end
private
def container_name(version = nil)
[ role.container_prefix, version || config.version ].compact.join("-")
end
def latest_image_id
docker :image, :ls, *argumentize("--filter", "reference=#{config.latest_image}"), "--format", "'{{.ID}}'"
end
def current_running_container(format:)
pipe \
shell(chain(latest_image_container(format: format), latest_container(format: format))),
[ :head, "-1" ]
end
def latest_image_container(format:)
latest_container format: format, filters: [ "ancestor=$(#{latest_image_id.join(" ")})" ]
end
def latest_container(format:, filters: nil)
docker :ps, "--latest", *format, *filter_args(statuses: ACTIVE_DOCKER_STATUSES), argumentize("--filter", filters)
[ role_config.container_prefix, version || config.version ].compact.join("-")
end
def filter_args(statuses: nil)
argumentize "--filter", filters(statuses: statuses)
end
def extract_version_from_name
# Extract SHA from "service-role-dest-SHA"
%(while read line; do echo ${line##{role.container_prefix}-}; done)
def service_role_dest
[ config.service, role, config.destination ].compact.join("-")
end
def filters(statuses: nil)

View File

@@ -1,20 +1,20 @@
module Kamal::Commands::App::Assets
def extract_assets
asset_container = "#{role.container_prefix}-assets"
asset_container = "#{role_config.container_prefix}-assets"
combine \
make_directory(role.asset_extracted_path),
make_directory(role_config.asset_extracted_path),
[*docker(:stop, "-t 1", asset_container, "2> /dev/null"), "|| true"],
docker(:run, "--name", asset_container, "--detach", "--rm", config.absolute_image, "sleep 1000000"),
docker(:cp, "-L", "#{asset_container}:#{role.asset_path}/.", role.asset_extracted_path),
docker(:run, "--name", asset_container, "--detach", "--rm", config.latest_image, "sleep 1000000"),
docker(:cp, "-L", "#{asset_container}:#{role_config.asset_path}/.", role_config.asset_extracted_path),
docker(:stop, "-t 1", asset_container),
by: "&&"
end
def sync_asset_volumes(old_version: nil)
new_extracted_path, new_volume_path = role.asset_extracted_path(config.version), role.asset_volume.host_path
new_extracted_path, new_volume_path = role_config.asset_extracted_path(config.version), role_config.asset_volume.host_path
if old_version.present?
old_extracted_path, old_volume_path = role.asset_extracted_path(old_version), role.asset_volume(old_version).host_path
old_extracted_path, old_volume_path = role_config.asset_extracted_path(old_version), role_config.asset_volume(old_version).host_path
end
commands = [make_directory(new_volume_path), copy_contents(new_extracted_path, new_volume_path)]
@@ -29,8 +29,8 @@ module Kamal::Commands::App::Assets
def clean_up_assets
chain \
find_and_remove_older_siblings(role.asset_extracted_path),
find_and_remove_older_siblings(role.asset_volume_path)
find_and_remove_older_siblings(role_config.asset_extracted_path),
find_and_remove_older_siblings(role_config.asset_volume_path)
end
private
@@ -39,7 +39,7 @@ module Kamal::Commands::App::Assets
:find,
Pathname.new(path).dirname.to_s,
"-maxdepth 1",
"-name", "'#{role.container_prefix}-*'",
"-name", "'#{role_config.container_prefix}-*'",
"!", "-name", Pathname.new(path).basename.to_s,
"-exec rm -rf \"{}\" +"
]

View File

@@ -2,7 +2,7 @@ module Kamal::Commands::App::Cord
def cord(version:)
pipe \
docker(:inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", container_name(version)),
[ :awk, "'$2 == \"#{role.cord_volume.container_path}\" {print $1}'" ]
[:awk, "'$2 == \"#{role_config.cord_volume.container_path}\" {print $1}'"]
end
def tie_cord(cord)

View File

@@ -1,29 +1,27 @@
module Kamal::Commands::App::Execution
def execute_in_existing_container(*command, interactive: false, env:)
def execute_in_existing_container(*command, interactive: false)
docker :exec,
("-it" if interactive),
*argumentize("--env", env),
container_name,
*command
end
def execute_in_new_container(*command, interactive: false, env:)
def execute_in_new_container(*command, interactive: false)
docker :run,
("-it" if interactive),
"--rm",
*role&.env_args,
*argumentize("--env", env),
*role_config&.env_args,
*config.volume_args,
*role&.option_args,
*role_config&.option_args,
config.absolute_image,
*command
end
def execute_in_existing_container_over_ssh(*command, host:, env:)
run_over_ssh execute_in_existing_container(*command, interactive: true, env: env), host: host
def execute_in_existing_container_over_ssh(*command, host:)
run_over_ssh execute_in_existing_container(*command, interactive: true), host: host
end
def execute_in_new_container_over_ssh(*command, host:, env:)
run_over_ssh execute_in_new_container(*command, interactive: true, env: env), host: host
def execute_in_new_container_over_ssh(*command, host:)
run_over_ssh execute_in_new_container(*command, interactive: true), host: host
end
end

View File

@@ -7,7 +7,7 @@ module Kamal::Commands::App::Images
docker :image, :prune, "--all", "--force", *filter_args
end
def tag_latest_image
def tag_current_image_as_latest
docker :tag, config.absolute_image, config.latest_image
end
end

View File

@@ -6,11 +6,11 @@ module Kamal::Commands::App::Logging
("grep '#{grep}'" if grep)
end
def follow_logs(host:, lines: nil, grep: nil)
def follow_logs(host:, grep: nil)
run_over_ssh \
pipe(
current_running_container_id,
"xargs docker logs --timestamps#{" --tail #{lines}" if lines} --follow 2>&1",
"xargs docker logs --timestamps --tail 10 --follow 2>&1",
(%(grep "#{grep}") if grep)
),
host: host

View File

@@ -21,7 +21,7 @@ class Kamal::Commands::Auditor < Kamal::Commands::Base
def audit_log_file
file = [ config.service, config.destination, "audit.log" ].compact.join("-")
File.join(config.run_directory, file)
"#{config.run_directory}/#{file}"
end
def audit_tags(**details)

View File

@@ -62,26 +62,14 @@ module Kamal::Commands
combine *commands, by: ">"
end
def any(*commands)
combine *commands, by: "||"
end
def xargs(command)
[ :xargs, command ].flatten
end
def shell(command)
[ :sh, "-c", "'#{command.flatten.join(" ").gsub("'", "'\\\\''")}'" ]
end
def docker(*args)
args.compact.unshift :docker
end
def git(*args)
args.compact.unshift :git
end
def tags(**details)
Kamal::Tags.from_config(config, **details)
end

View File

@@ -3,7 +3,7 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
class BuilderError < StandardError; end
delegate :argumentize, to: Kamal::Utils
delegate :args, :secrets, :dockerfile, :local_arch, :local_host, :remote_arch, :remote_host, :cache_from, :cache_to, :ssh, :git_archive?, to: :builder_config
delegate :args, :secrets, :dockerfile, :local_arch, :local_host, :remote_arch, :remote_host, :cache_from, :cache_to, to: :builder_config
def clean
docker :image, :rm, "--force", config.absolute_image
@@ -13,18 +13,8 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
docker :pull, config.absolute_image
end
def push
if git_archive?
pipe \
git(:archive, "--format=tar", :HEAD),
build_and_push
else
build_and_push
end
end
def build_options
[ *build_tags, *build_cache, *build_labels, *build_args, *build_secrets, *build_dockerfile, *build_ssh ]
[ *build_tags, *build_cache, *build_labels, *build_args, *build_secrets, *build_dockerfile ]
end
def build_context
@@ -34,10 +24,7 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
def validate_image
pipe \
docker(:inspect, "-f", "'{{ .Config.Labels.service }}'", config.absolute_image),
any(
[ :grep, "-x", config.service ],
"(echo \"Image #{config.absolute_image} is missing the 'service' label\" && exit 1)"
)
[:grep, "-x", config.service, "||", "(echo \"Image #{config.absolute_image} is missing the `service` label\" && exit 1)"]
end
@@ -73,10 +60,6 @@ class Kamal::Commands::Builder::Base < Kamal::Commands::Base
end
end
def build_ssh
argumentize "--ssh", ssh if ssh.present?
end
def builder_config
config.builder
end

View File

@@ -7,6 +7,15 @@ class Kamal::Commands::Builder::Multiarch < Kamal::Commands::Builder::Base
docker :buildx, :rm, builder_name
end
def push
docker :buildx, :build,
"--push",
"--platform", "linux/amd64,linux/arm64",
"--builder", builder_name,
*build_options,
build_context
end
def info
combine \
docker(:context, :ls),
@@ -17,21 +26,4 @@ class Kamal::Commands::Builder::Multiarch < Kamal::Commands::Builder::Base
def builder_name
"kamal-#{config.service}-multiarch"
end
def platform_names
if local_arch
"linux/#{local_arch}"
else
"linux/amd64,linux/arm64"
end
end
def build_and_push
docker :buildx, :build,
"--push",
"--platform", platform_names,
"--builder", builder_name,
*build_options,
build_context
end
end

View File

@@ -7,15 +7,14 @@ class Kamal::Commands::Builder::Native < Kamal::Commands::Builder::Base
# No-op on native without cache
end
def info
# No-op on native
end
private
def build_and_push
def push
combine \
docker(:build, *build_options, build_context),
docker(:push, config.absolute_image),
docker(:push, config.latest_image)
end
def info
# No-op on native
end
end

View File

@@ -7,8 +7,7 @@ class Kamal::Commands::Builder::Native::Cached < Kamal::Commands::Builder::Nativ
docker :buildx, :rm, builder_name
end
private
def build_and_push
def push
docker :buildx, :build,
"--push",
*build_options,

View File

@@ -11,6 +11,15 @@ class Kamal::Commands::Builder::Native::Remote < Kamal::Commands::Builder::Nativ
remove_buildx
end
def push
docker :buildx, :build,
"--push",
"--platform", platform,
"--builder", builder_name,
*build_options,
build_context
end
def info
chain \
docker(:context, :ls),
@@ -47,13 +56,4 @@ class Kamal::Commands::Builder::Native::Remote < Kamal::Commands::Builder::Nativ
def remove_buildx
docker :buildx, :rm, builder_name
end
def build_and_push
docker :buildx, :build,
"--push",
"--platform", platform,
"--builder", builder_name,
*build_options,
build_context
end
end

View File

@@ -1,7 +1,7 @@
class Kamal::Commands::Docker < Kamal::Commands::Base
# Install Docker using the https://github.com/docker/docker-install convenience script.
def install
pipe get_docker, :sh
pipe [ :curl, "-fsSL", "https://get.docker.com" ], :sh
end
# Checks the Docker client version. Fails if Docker is not installed.
@@ -18,13 +18,4 @@ class Kamal::Commands::Docker < Kamal::Commands::Base
def superuser?
[ '[ "${EUID:-$(id -u)}" -eq 0 ] || command -v sudo >/dev/null || command -v su >/dev/null' ]
end
private
def get_docker
shell \
any \
[ :curl, "-fsSL", "https://get.docker.com" ],
[ :wget, "-O -", "https://get.docker.com" ],
[ :echo, "\"exit 1\"" ]
end
end

View File

@@ -1,4 +1,5 @@
class Kamal::Commands::Healthcheck < Kamal::Commands::Base
def run
primary = config.role(config.primary_role)

View File

@@ -9,6 +9,6 @@ class Kamal::Commands::Hook < Kamal::Commands::Base
private
def hook_file(hook)
File.join(config.hooks_path, hook)
"#{config.hooks_path}/#{hook}"
end
end

View File

@@ -1,6 +1,5 @@
require "active_support/duration"
require "time"
require "base64"
class Kamal::Commands::Lock < Kamal::Commands::Base
def acquire(message, version)
@@ -21,10 +20,6 @@ class Kamal::Commands::Lock < Kamal::Commands::Base
read_lock_details
end
def ensure_locks_directory
[ :mkdir, "-p", locks_dir ]
end
private
def write_lock_details(message, version)
write \
@@ -44,18 +39,12 @@ class Kamal::Commands::Lock < Kamal::Commands::Base
"/dev/null"
end
def locks_dir
File.join(config.run_directory, "locks")
end
def lock_dir
dir_name = [ config.service, config.destination ].compact.join("-")
File.join(locks_dir, dir_name)
"#{config.run_directory}/lock-#{config.service}"
end
def lock_details_file
File.join(lock_dir, "details")
[lock_dir, :details].join("/")
end
def lock_details(message, version)

View File

@@ -13,10 +13,10 @@ class Kamal::Commands::Prune < Kamal::Commands::Base
"while read image tag; do docker rmi $tag; done"
end
def app_containers(retain:)
def app_containers(keep_last: 5)
pipe \
docker(:ps, "-q", "-a", *service_filter, *stopped_containers_filters),
"tail -n +#{retain + 1}",
"tail -n +#{keep_last + 1}",
"while read container_id; do docker rm $container_id; done"
end

View File

@@ -2,10 +2,7 @@ class Kamal::Commands::Registry < Kamal::Commands::Base
delegate :registry, to: :config
def login
docker :login,
registry["server"],
"-u", sensitive(Kamal::Utils.escape_shell_value(lookup("username"))),
"-p", sensitive(Kamal::Utils.escape_shell_value(lookup("password")))
docker :login, registry["server"], "-u", sensitive(lookup("username")), "-p", sensitive(lookup("password"))
end
def logout

View File

@@ -1,10 +1,10 @@
class Kamal::Commands::Traefik < Kamal::Commands::Base
delegate :argumentize, :optionize, to: Kamal::Utils
DEFAULT_IMAGE = "traefik:v2.10"
DEFAULT_IMAGE = "traefik:v2.9"
CONTAINER_PORT = 80
DEFAULT_ARGS = {
"log.level" => "DEBUG"
'log.level' => 'DEBUG'
}
DEFAULT_LABELS = {
# These ensure we serve a 502 rather than a 404 if no containers are available
@@ -39,7 +39,7 @@ class Kamal::Commands::Traefik < Kamal::Commands::Base
end
def start_or_run
any start, run
combine start, run, by: "||"
end
def info
@@ -71,18 +71,20 @@ class Kamal::Commands::Traefik < Kamal::Commands::Base
"#{host_port}:#{CONTAINER_PORT}"
end
def env
Kamal::Configuration::Env.from_config \
config: config.traefik.fetch("env", {}),
secrets_file: File.join(config.host_env_directory, "traefik", "traefik.env")
def env_file
Kamal::EnvFile.new(config.traefik.fetch("env", {}))
end
def host_env_file_path
File.join host_env_directory, "traefik.env"
end
def make_env_directory
make_directory(env.secrets_directory)
make_directory(host_env_directory)
end
def remove_env_file
[ :rm, "-f", env.secrets_file ]
[:rm, "-f", host_env_file_path]
end
private
@@ -95,7 +97,11 @@ class Kamal::Commands::Traefik < Kamal::Commands::Base
end
def env_args
env.args
argumentize "--env-file", host_env_file_path
end
def host_env_directory
File.join config.host_env_directory, "traefik"
end
def labels

View File

@@ -6,7 +6,7 @@ require "erb"
require "net/ssh/proxy/jump"
class Kamal::Configuration
delegate :service, :image, :servers, :labels, :registry, :stop_wait_time, :hooks_path, :logging, to: :raw_config, allow_nil: true
delegate :service, :image, :servers, :env, :labels, :registry, :stop_wait_time, :hooks_path, to: :raw_config, allow_nil: true
delegate :argumentize, :optionize, to: Kamal::Utils
attr_reader :destination, :raw_config
@@ -71,9 +71,7 @@ class Kamal::Configuration
def roles
@roles ||= role_names.collect do |role_name|
Role.new(role_name, config: self, specializations: role_specializations(role_name), primary: role_name == primary_role_name)
end
@roles ||= role_names.collect { |role_name| Role.new(role_name, config: self) }
end
def role(name)
@@ -90,23 +88,11 @@ class Kamal::Configuration
def all_hosts
(roles + accessories).flat_map(&:hosts).uniq
roles.flat_map(&:hosts).uniq
end
def primary_host
primary_role&.primary_host
end
def primary_role_name
raw_config.primary_role || "web"
end
def primary_role
role(primary_role_name)
end
def allow_empty_roles?
raw_config.allow_empty_roles
role(primary_role)&.primary_host
end
def traefik_roles
@@ -130,11 +116,7 @@ class Kamal::Configuration
end
def latest_image
"#{repository}:#{latest_tag}"
end
def latest_tag
[ "latest", *destination ].join("-")
"#{repository}:latest"
end
def service_with_version
@@ -145,10 +127,6 @@ class Kamal::Configuration
raw_config.require_destination
end
def retain_containers
raw_config.retain_containers || 5
end
def volume_args
if raw_config.volumes.present?
@@ -159,9 +137,9 @@ class Kamal::Configuration
end
def logging_args
if logging.present?
optionize({ "log-driver" => logging["driver"] }.compact) +
argumentize("--log-opt", logging["options"])
if raw_config.logging.present?
optionize({ "log-driver" => raw_config.logging["driver"] }.compact) +
argumentize("--log-opt", raw_config.logging["options"])
else
argumentize("--log-opt", { "max-size" => "10m" })
end
@@ -222,22 +200,25 @@ class Kamal::Configuration
raw_config.hooks_path || ".kamal/hooks"
end
def host_env_directory
"#{run_directory}/env"
end
def asset_path
raw_config.asset_path
end
def host_env_directory
File.join(run_directory, "env")
def primary_role
raw_config.primary_role || "web"
end
def env
raw_config.env || {}
def allow_empty_roles?
raw_config.allow_empty_roles
end
def valid?
ensure_destination_if_required && ensure_required_keys_present && ensure_valid_kamal_version && ensure_retain_containers_valid && ensure_valid_service_name
ensure_destination_if_required && ensure_required_keys_present && ensure_valid_kamal_version
end
def to_h
@@ -283,12 +264,12 @@ class Kamal::Configuration
raise ArgumentError, "You must specify a password for the registry in config/deploy.yml (or set the ENV variable if that's used)"
end
unless role_names.include?(primary_role_name)
raise ArgumentError, "The primary_role #{primary_role_name} isn't defined"
unless role_names.include?(primary_role)
raise ArgumentError, "The primary_role #{primary_role} isn't defined"
end
if primary_role.hosts.empty?
raise ArgumentError, "No servers specified for the #{primary_role.name} primary_role"
if role(primary_role).hosts.empty?
raise ArgumentError, "No servers specified for the #{primary_role} primary_role"
end
unless allow_empty_roles?
@@ -302,12 +283,6 @@ class Kamal::Configuration
true
end
def ensure_valid_service_name
raise ArgumentError, "Service name can only include alphanumeric characters, hyphens, and underscores" unless raw_config[:service] =~ /^[a-z0-9_-]+$/i
true
end
def ensure_valid_kamal_version
if minimum_version && Gem::Version.new(minimum_version) > Gem::Version.new(Kamal::VERSION)
raise ArgumentError, "Current version is #{Kamal::VERSION}, minimum required is #{minimum_version}"
@@ -316,32 +291,15 @@ class Kamal::Configuration
true
end
def ensure_retain_containers_valid
raise ArgumentError, "Must retain at least 1 container" if retain_containers < 1
true
end
def role_names
raw_config.servers.is_a?(Array) ? [ "web" ] : raw_config.servers.keys.sort
end
def role_specializations(name)
if servers.is_a?(Array) || servers[name].is_a?(Array)
{}
else
servers[name].except("hosts")
end
end
def git_version
@git_version ||=
if Kamal::Git.used?
if Kamal::Git.uncommitted_changes.present? && !builder.git_archive?
uncommitted_suffix = "_uncommitted_#{SecureRandom.hex(8)}"
end
[ Kamal::Git.revision, uncommitted_suffix ].compact.join
[ Kamal::Git.revision, Kamal::Git.uncommitted_changes.present? ? "_uncommitted_#{SecureRandom.hex(8)}" : "" ].join
else
raise "Can't use commit hash as version, no git repository found in #{Dir.pwd}"
end

View File

@@ -8,7 +8,7 @@ class Kamal::Configuration::Accessory
end
def service_name
specifics["service"] || "#{config.service}-#{name}"
"#{config.service}-#{name}"
end
def image
@@ -42,13 +42,23 @@ class Kamal::Configuration::Accessory
end
def env
Kamal::Configuration::Env.from_config \
config: specifics.fetch("env", {}),
secrets_file: File.join(config.host_env_directory, "accessories", "#{service_name}.env")
specifics["env"] || {}
end
def env_file
Kamal::EnvFile.new(env)
end
def host_env_directory
File.join config.host_env_directory, "accessories"
end
def host_env_file_path
File.join host_env_directory, "#{service_name}.env"
end
def env_args
env.args
argumentize "--env-file", host_env_file_path
end
def files
@@ -60,8 +70,8 @@ class Kamal::Configuration::Accessory
def directories
specifics["directories"]&.to_h do |host_to_container_mapping|
host_path, container_path = host_to_container_mapping.split(":")
[ expand_host_path(host_path), container_path ]
host_relative_path, container_path = host_to_container_mapping.split(":")
[ expand_host_path(host_relative_path), container_path ]
end || {}
end
@@ -101,10 +111,10 @@ class Kamal::Configuration::Accessory
end
def with_clear_env_loaded
env.clear.each { |k, v| ENV[k] = v }
(env["clear"] || env).each { |k, v| ENV[k] = v }
yield
ensure
env.clear.each { |k, v| ENV.delete(k) }
(env["clear"] || env).each { |k, v| ENV.delete(k) }
end
def read_dynamic_file(local_file)
@@ -128,17 +138,13 @@ class Kamal::Configuration::Accessory
def remote_directories_as_volumes
specifics["directories"]&.collect do |host_to_container_mapping|
host_path, container_path = host_to_container_mapping.split(":")
[ expand_host_path(host_path), container_path ].join(":")
host_relative_path, container_path = host_to_container_mapping.split(":")
[ expand_host_path(host_relative_path), container_path ].join(":")
end || []
end
def expand_host_path(host_path)
absolute_path?(host_path) ? host_path : File.join(service_data_directory, host_path)
end
def absolute_path?(path)
Pathname.new(path).absolute?
def expand_host_path(host_relative_path)
"#{service_data_directory}/#{host_relative_path}"
end
def service_data_directory

View File

@@ -8,7 +8,7 @@ class Kamal::Configuration::Boot
limit = @options["limit"]
if limit.to_s.end_with?("%")
[ @host_count * limit.to_i / 100, 1 ].max
@host_count * limit.to_i / 100
else
limit
end

View File

@@ -40,7 +40,7 @@ class Kamal::Configuration::Builder
end
def context
@options["context"] || (git_archive? ? "-" : ".")
@options["context"] || "."
end
def local_arch
@@ -81,14 +81,6 @@ class Kamal::Configuration::Builder
end
end
def ssh
@options["ssh"]
end
def git_archive?
Kamal::Git.used? && @options["context"].nil?
end
private
def valid?
if @options["cache"] && @options["cache"]["type"]

View File

@@ -1,40 +0,0 @@
class Kamal::Configuration::Env
attr_reader :secrets_keys, :clear, :secrets_file
delegate :argumentize, to: Kamal::Utils
def self.from_config(config:, secrets_file: nil)
secrets_keys = config.fetch("secret", [])
clear = config.fetch("clear", config.key?("secret") ? {} : config)
new clear: clear, secrets_keys: secrets_keys, secrets_file: secrets_file
end
def initialize(clear:, secrets_keys:, secrets_file:)
@clear = clear
@secrets_keys = secrets_keys
@secrets_file = secrets_file
end
def args
[ "--env-file", secrets_file, *argumentize("--env", clear) ]
end
def secrets_io
StringIO.new(Kamal::EnvFile.new(secrets).to_s)
end
def secrets
@secrets ||= secrets_keys.to_h { |key| [ key, ENV.fetch(key) ] }
end
def secrets_directory
File.dirname(secrets_file)
end
def merge(other)
self.class.new \
clear: @clear.merge(other.clear),
secrets_keys: @secrets_keys | other.secrets_keys,
secrets_file: secrets_file
end
end

View File

@@ -2,11 +2,10 @@ class Kamal::Configuration::Role
CORD_FILE = "cord"
delegate :argumentize, :optionize, to: Kamal::Utils
attr_reader :name
alias to_s name
attr_accessor :name
def initialize(name, config:, specializations:, primary:)
@name, @config, @specializations, @primary = name.inquiry, config, specializations, primary
def initialize(name, config:)
@name, @config = name.inquiry, config
end
def primary_host
@@ -37,25 +36,29 @@ class Kamal::Configuration::Role
argumentize "--label", labels
end
def logging_args
args = config.logging || {}
args.deep_merge!(specializations["logging"]) if specializations["logging"].present?
if args.any?
optionize({ "log-driver" => args["driver"] }.compact) +
argumentize("--log-opt", args["options"])
else
config.logging_args
end
end
def env
@env ||= base_env.merge(specialized_env)
if config.env && config.env["secret"]
merged_env_with_secrets
else
merged_env
end
end
def env_file
Kamal::EnvFile.new(env)
end
def host_env_directory
File.join config.host_env_directory, "roles"
end
def host_env_file_path
File.join host_env_directory, "#{[config.service, name, config.destination].compact.join("-")}.env"
end
def env_args
env.args
argumentize "--env-file", host_env_file_path
end
def asset_volume_args
@@ -98,7 +101,7 @@ class Kamal::Configuration::Role
end
def primary?
@primary
@config.primary_role == name
end
@@ -163,14 +166,8 @@ class Kamal::Configuration::Role
File.join config.run_directory, "assets", "volumes", container_name(version)
end
def previous_roles
previous_role_names.map do |role_name|
Kamal::Configuration::Role.new(role_name, config: config, specializations: specializations, primary: primary?)
end
end
private
attr_reader :config, :specializations
attr_accessor :config
def extract_hosts_from_config
if config.servers.is_a?(Array)
@@ -182,7 +179,11 @@ class Kamal::Configuration::Role
end
def default_labels
if config.destination
{ "service" => config.service, "role" => name, "destination" => config.destination }
else
{ "service" => config.service, "role" => name }
end
end
def traefik_labels
@@ -203,7 +204,7 @@ class Kamal::Configuration::Role
end
def traefik_service
container_prefix
[ config.service, name, config.destination ].compact.join("-")
end
def custom_labels
@@ -213,15 +214,33 @@ class Kamal::Configuration::Role
end
end
def specializations
if config.servers.is_a?(Array) || config.servers[name].is_a?(Array)
{ }
else
config.servers[name].except("hosts")
end
end
def specialized_env
Kamal::Configuration::Env.from_config config: specializations.fetch("env", {})
specializations["env"] || {}
end
def merged_env
config.env&.merge(specialized_env) || {}
end
# Secrets are stored in an array, which won't merge by default, so have to do it by hand.
def base_env
Kamal::Configuration::Env.from_config \
config: config.env,
secrets_file: File.join(config.host_env_directory, "roles", "#{container_prefix}.env")
def merged_env_with_secrets
merged_env.tap do |new_env|
new_env["secret"] = Array(config.env["secret"]) + Array(specialized_env["secret"])
# If there's no secret/clear split, everything is clear
clear_app_env = config.env["secret"] ? Array(config.env["clear"]) : Array(config.env["clear"] || config.env)
clear_role_env = specialized_env["secret"] ? Array(specialized_env["clear"]) : Array(specialized_env["clear"] || specialized_env)
new_env["clear"] = (clear_app_env + clear_role_env).uniq
end
end
def http_health_check(port:, path:)
@@ -235,8 +254,4 @@ class Kamal::Configuration::Role
options
end
end
def previous_role_names
specializations.fetch("previously", [])
end
end

View File

@@ -6,9 +6,19 @@ class Kamal::EnvFile
def to_s
env_file = StringIO.new.tap do |contents|
@env.each do |key, value|
if (secrets = @env["secret"]).present?
@env.fetch("secret", @env)&.each do |key|
contents << docker_env_file_line(key, ENV.fetch(key))
end
@env["clear"]&.each do |key, value|
contents << docker_env_file_line(key, value)
end
else
@env.fetch("clear", @env)&.each do |key, value|
contents << docker_env_file_line(key, value)
end
end
end.string
# Ensure the file has some contents to avoid the SSHKIT empty file warning
@@ -19,18 +29,11 @@ class Kamal::EnvFile
private
def docker_env_file_line(key, value)
"#{key}=#{escape_docker_env_file_value(value)}\n"
"#{key.to_s}=#{escape_docker_env_file_value(value)}\n"
end
# Escape a value to make it safe to dump in a docker file.
def escape_docker_env_file_value(value)
# keep non-ascii(UTF-8) characters as it is
value.to_s.scan(/[\x00-\x7F]+|[^\x00-\x7F]+/).map do |part|
part.ascii_only? ? escape_docker_env_file_ascii_value(part) : part
end.join
end
def escape_docker_env_file_ascii_value(value)
# Doublequotes are treated literally in docker env files
# so remove leading and trailing ones and unescape any others
value.to_s.dump[1..-2].gsub(/\\"/, "\"")

View File

@@ -1,6 +1,5 @@
require "sshkit"
require "sshkit/dsl"
require "net/scp"
require "active_support/core_ext/hash/deep_merge"
require "json"

View File

@@ -66,7 +66,7 @@ module Kamal::Utils
Array(filters).select do |filter|
matches += Array(items).select do |item|
# Only allow * for a wildcard
pattern = Regexp.escape(filter).gsub('\*', ".*")
pattern = Regexp.escape(filter).gsub('\*', '.*')
# items are roles or hosts
(item.respond_to?(:name) ? item.name : item).match(/^#{pattern}$/)
end
@@ -74,8 +74,4 @@ module Kamal::Utils
matches
end
def stable_sort!(elements, &block)
elements.sort_by!.with_index { |element, index| [ block.call(element), index ] }
end
end

View File

@@ -1,3 +1,3 @@
module Kamal
VERSION = "1.5.0"
VERSION = "1.2.0"
end

747
queries Normal file
View File

@@ -0,0 +1,747 @@
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 59025) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 59025 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119381456 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 59025) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 59025 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119381456 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 32020052 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 32020052 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 32020052 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31865394 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31865394 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31865394 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-05-24 13:51:14' AND `postings`.`id` < 573587552 OR `postings`.`active_at` < '2023-05-24 13:51:14') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 151981) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 151981 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118823782 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 151981) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 151981 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118823782 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43054800 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43054800 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43054800 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10606498 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10606498 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10606498 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10848889 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10848889 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 118897) AND `postings`.`user_id` = 119003 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10848889 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-09 14:32:14' AND `postings`.`id` < 649775156 OR `postings`.`active_at` < '2023-10-09 14:32:14') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 17:44:13' AND `postings`.`id` < 657298529 OR `postings`.`active_at` < '2023-10-23 17:44:13') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 370688) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 370688 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 41893190 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 370688) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 370688 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 41893190 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 370688) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 370688 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 41893190 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-05-24 13:51:14' AND `postings`.`id` < 573587552 OR `postings`.`active_at` < '2023-05-24 13:51:14') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-05-24 13:51:14' AND `postings`.`id` < 573587552 OR `postings`.`active_at` < '2023-05-24 13:51:14') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 39582006 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-05 15:21:00' AND `postings`.`id` < 647893980 OR `postings`.`active_at` < '2023-10-05 15:21:00') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-05 15:21:00' AND `postings`.`id` < 647893980 OR `postings`.`active_at` < '2023-10-05 15:21:00') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-09 14:32:14' AND `postings`.`id` < 649775156 OR `postings`.`active_at` < '2023-10-09 14:32:14') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-09 14:32:14' AND `postings`.`id` < 649775156 OR `postings`.`active_at` < '2023-10-09 14:32:14') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95669098 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95669098 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95669098 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 84297) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 84297 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (2642394, 35010213) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 84297) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 84297 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (2642394, 35010213) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 84297) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 84297 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (2642394, 35010213) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43209843 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43209843 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43209843 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 17:44:13' AND `postings`.`id` < 657298529 OR `postings`.`active_at` < '2023-10-23 17:44:13') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 17:44:13' AND `postings`.`id` < 657298529 OR `postings`.`active_at` < '2023-10-23 17:44:13') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 72157418 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 72157418 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 72157418 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13611555 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13611555 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13611555 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 06:39:33' AND `postings`.`id` < 656985167 OR `postings`.`active_at` < '2023-10-23 06:39:33') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84272411 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84272411 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84272411 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 485652) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 485652 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87516401 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 7721) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 7721 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115911671 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 7721) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 7721 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115911671 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 151981) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 151981 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119110998 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 151981) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 151981 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119110998 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 588826) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 588826 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93003659 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-28 22:12:35' AND `postings`.`id` < 660131690 OR `postings`.`active_at` < '2023-10-28 22:12:35') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 588826) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 588826 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93003659 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 588826) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 588826 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93003659 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-28 22:12:35' AND `postings`.`id` < 660131690 OR `postings`.`active_at` < '2023-10-28 22:12:35') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 588826) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 588826 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93003659 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 588826) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 588826 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93003659 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 588826) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 588826 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93003659 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 5426797 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 5426797 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308626) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308626 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56825807 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308626) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308626 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56825807 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308626) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308626 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56825807 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 676435) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 676435 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119502850 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 676435) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 676435 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119502850 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 408705) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 408705 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 51574069 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 408705) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 408705 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 51574069 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 408705) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 408705 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 51574069 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 9102198 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 9102198 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 9102198 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10309490 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 10309490 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2924436 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2924436 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2924436 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 51849337 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 51849337 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 51849337 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 394713 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 394713 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 394713 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56535) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56535 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 23772297 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56535) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56535 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 23772297 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56535) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56535 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 23772297 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 14499825 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 14499825 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 14499825 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-08-07 19:26:21' AND `postings`.`id` < 616917013 OR `postings`.`active_at` < '2023-08-07 19:26:21') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-08-07 19:26:21' AND `postings`.`id` < 616917013 OR `postings`.`active_at` < '2023-08-07 19:26:21') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77760390 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77760390 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77760390 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 326042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 326042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 103260200 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 326042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 326042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 103260200 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 326042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 326042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 103260200 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119203199 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119203199 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119203199 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56535) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56535 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 23772297 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56535) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56535 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 23772297 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56535) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56535 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 23772297 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 151981) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 151981 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119110998 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 151981) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 151981 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119110998 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-09-13 18:34:50' AND `postings`.`id` < 636001768 OR `postings`.`active_at` < '2023-09-13 18:34:50') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-09-13 18:34:50' AND `postings`.`id` < 636001768 OR `postings`.`active_at` < '2023-09-13 18:34:50') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 109157576 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13611555 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13611555 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13611555 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 47631839 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 47631839 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 47631839 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 403429) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 403429 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93300194 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 403429) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 403429 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93300194 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 403429) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 403429 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93300194 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43209843 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43209843 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 43209843 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84272411 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84272411 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84272411 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 72157418 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 72157418 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 72157418 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 106168454 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 106168454 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 106168454 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95669098 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95669098 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69863) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69863 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95669098 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 106701) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 106701 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (80724859, 81734592, 94302743, 97557423, 111322424, 115829014, 118870881, 119410658, 119615407) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 106701) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 106701 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (80724859, 81734592, 94302743, 97557423, 111322424, 115829014, 118870881, 119410658, 119615407) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 106701) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 106701 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (80724859, 81734592, 94302743, 97557423, 111322424, 115829014, 118870881, 119410658, 119615407) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36891) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36891 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 18388225 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36891) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36891 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 18388225 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36891) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36891 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 18388225 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36891) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36891 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33385164 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36891) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36891 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33385164 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36891) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36891 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33385164 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 632073) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 632073 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119733421 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 632073) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 632073 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119733421 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36889) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36889 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26619991 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36889) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36889 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26619991 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 36889) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 36889 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26619991 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308626) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308626 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56825807 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308626) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308626 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56825807 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308626) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308626 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56825807 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 38036607 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 342492) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 342492 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 38036607 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119203199 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119203199 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 62886) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 62886 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119203199 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8632) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8632 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 5390784 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8632) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8632 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 5390784 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8632) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8632 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 5390784 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190507) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190507 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 37709374 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190507) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190507 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 37709374 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-27 15:05:17' AND `postings`.`id` < 659627569 OR `postings`.`active_at` < '2023-10-27 15:05:17') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-27 15:05:17' AND `postings`.`id` < 659627569 OR `postings`.`active_at` < '2023-10-27 15:05:17') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-30 19:21:53' AND `postings`.`id` < 661074897 OR `postings`.`active_at` < '2023-10-30 19:21:53') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-30 19:21:53' AND `postings`.`id` < 661074897 OR `postings`.`active_at` < '2023-10-30 19:21:53') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9440) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9440 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 100252298 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9440) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9440 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 100252298 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 279617) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 279617 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 26321209 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9440) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9440 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 100252298 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9440) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9440 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 100252298 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 26889) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 26889 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 46998542 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 26889) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 26889 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 46998542 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 26889) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 26889 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 46998542 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 413538) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 413538 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77866350 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 413538) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 413538 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77866350 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 413538) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 413538 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77866350 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 413538) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 413538 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77866350 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 413538) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 413538 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77866350 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 413538) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 413538 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77866350 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118023856 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118023856 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118023856 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118023856 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118023856 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 25064) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 25064 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118023856 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 268321) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 268321 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21335768 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 268321) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 268321 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21335768 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 268321) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 268321 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21335768 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 27503) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 27503 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 67848026 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 27503) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 27503 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 67848026 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 27503) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 27503 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 67848026 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 22079) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 22079 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 17884675 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 22079) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 22079 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 17884675 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 22079) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 22079 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 17884675 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19615) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19615 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21386410 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19615) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19615 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21386410 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 27503) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 27503 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 67848026 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 27503) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 27503 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 67848026 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 27503) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 27503 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 67848026 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120383718 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120383718 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 06:39:33' AND `postings`.`id` < 656985167 OR `postings`.`active_at` < '2023-10-23 06:39:33') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 06:39:33' AND `postings`.`id` < 656985167 OR `postings`.`active_at` < '2023-10-23 06:39:33') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 543042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 543042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84590992 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 543042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 543042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84590992 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 209325) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 209325 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 17245819 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 209325) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 209325 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 17245819 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 209325) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 209325 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 17245819 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 06:39:33' AND `postings`.`id` < 656985167 OR `postings`.`active_at` < '2023-10-23 06:39:33') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-23 06:39:33' AND `postings`.`id` < 656985167 OR `postings`.`active_at` < '2023-10-23 06:39:33') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 543042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 543042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84590992 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 543042) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 543042 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84590992 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 519925) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 519925 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118399008 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 631979) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 631979 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120388665 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 486976) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 486976 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93830993 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 486976) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 486976 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93830993 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 486976) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 486976 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93830993 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 401271) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 401271 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87719645 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 401271) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 401271 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87719645 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 401271) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 401271 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87719645 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 486976) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 486976 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 73334804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 486976) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 486976 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 73334804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 486976) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 486976 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 73334804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115635818 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115635818 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115635818 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115635818 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13785428 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13785428 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 190828) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 190828 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 13785428 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 284809) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 284809 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116105212 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 284809) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 284809 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116105212 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 88986) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 88986 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 3393193 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 88986) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 88986 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 3393193 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 88986) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 88986 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 3393193 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-02 09:08:54' AND `postings`.`id` < 642510482 OR `postings`.`active_at` < '2023-10-02 09:08:54') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-02 09:08:54' AND `postings`.`id` < 642510482 OR `postings`.`active_at` < '2023-10-02 09:08:54') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 500714) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 500714 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 78073547 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 500714) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 500714 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 78073547 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 500714) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 500714 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 78073547 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-10 10:45:41' AND `postings`.`id` < 650194493 OR `postings`.`active_at` < '2023-10-10 10:45:41') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-10 10:45:41' AND `postings`.`id` < 650194493 OR `postings`.`active_at` < '2023-10-10 10:45:41') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 500714) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 500714 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 78073547 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 500714) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 500714 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 78073547 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 500714) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 500714 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 78073547 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 431096) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 431096 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 57908443 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 431096) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 431096 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 57908443 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 431096) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 431096 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 57908443 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 431096) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 431096 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84723901 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 431096) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 431096 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84723901 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 431096) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 431096 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84723901 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2621824 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2621824 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2621824 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 661423) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 661423 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115482286 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 77353) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 77353 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116819688 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 77353) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 77353 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116819688 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286824) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286824 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 28767291 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286824) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286824 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 28767291 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286824) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286824 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 28767291 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286824) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286824 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 28027463 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286824) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286824 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 28027463 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286824) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286824 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 28027463 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (63127457, 88060240, 50) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (63127457, 88060240, 50) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (63127457, 88060240, 50) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (71966584, 51) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (71966584, 51) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (71966584, 51) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (76468147, 748) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (76468147, 748) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 459296) AND `postings`.`user_id` = 458356 AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (76468147, 748) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21087782 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21087782 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21087782 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2621824 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2621824 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2621824 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 18338647 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 18338647 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48515) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48515 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 18338647 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 475736) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 475736 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118961176 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 475736) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 475736 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118961176 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 403760) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 403760 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (84013362, 75976220, 75975710, 83747783) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 403760) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 403760 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (84013362, 75976220, 75975710, 83747783) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 403760) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 403760 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (84013362, 75976220, 75975710, 83747783) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 294130) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 294130 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 37679350 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 294130) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 294130 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 37679350 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 294130) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 294130 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 37679350 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8196) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8196 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33965695 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8196) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8196 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33965695 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8196) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8196 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33965695 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56647) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56647 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8864240 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56647) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56647 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8864240 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56647) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56647 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8864240 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56647) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56647 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8864240 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56647) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56647 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8864240 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 56647) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 56647 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8864240 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 663878) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 663878 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 114701678 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 663878) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 663878 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 114701678 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 308553) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 308553 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND 1=0 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 88298) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 88298 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 48317212 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 88298) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 88298 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 48317212 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 88298) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 88298 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 48317212 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 7721) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 7721 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119487362 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 7721) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 7721 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119487362 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 88784319 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 88784319 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 88784319 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 643630) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 643630 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 107220850 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 643630) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 643630 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 107220850 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 643630) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 643630 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 107220850 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 643630) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 643630 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 106743343 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 643630) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 643630 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 106743343 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 643630) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 643630 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 106743343 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 414461) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 414461 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116346748 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115457451 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115457451 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115457451 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115457451 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115457451 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115457451 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115597101 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115597101 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115597101 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118984666 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118984666 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118984666 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119426681 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119426681 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119426681 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119426681 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119426681 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119426681 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118984666 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118984666 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118984666 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115597101 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115597101 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 673234) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 673234 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 115597101 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 657631) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 657631 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119341168 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 657631) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 657631 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119341168 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 676435) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 676435 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119934130 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 676435) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 676435 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 119934130 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 96429) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 96429 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120249415 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 96429) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 96429 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120249415 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 33913) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 33913 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120327835 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 33913) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 33913 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120327835 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 71422751 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 71422751 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 71422751 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 41598746 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 41598746 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 41598746 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12263655 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12263655 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 160530) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 160530 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12263655 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 690327) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 690327 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120224951 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 690327) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 690327 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120224951 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 514673) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 514673 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116647878 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 514673) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 514673 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116647878 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 514673) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 514673 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116647878 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 270534) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 270534 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21308352 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 270534) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 270534 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21308352 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 270534) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 270534 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21308352 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 411111) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 411111 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120277784 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 411111) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 411111 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120277784 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 690327) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 690327 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120224951 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 690327) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 690327 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120224951 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87246737 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87246737 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87246737 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286561) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286561 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95747205 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286561) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286561 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95747205 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 286561) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 286561 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 95747205 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 4579632 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 4579632 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 4579632 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT `identity_preferences`.* FROM `identity_preferences` WHERE `identity_preferences`.`identity_id` = 22079 LIMIT 1\n Rendered layout layouts/application.html.erb (Duration: 1895.0ms | Allocations: 1056924)\nCompleted 200 OK in 1967ms (Views: 1110.9ms | ActiveRecord: 841.5ms | Elasticsearch: 0.0ms | Allocations: 1075172)\n""}"
SELECT COUNT(*) AS `size`, MAX(`entries`.`updated_at`) AS timestamp FROM `entries` WHERE `entries`.`creator_id` IN (SELECT `contacts`.`id` FROM `contacts` INNER JOIN `users` ON `contacts`.`contactable_id` = `users`.`id` WHERE `users`.`identity_id` = 203632 AND `contacts`.`contactable_type` = 'User') AND `entries`.`entryable_type` = 'Message' AND `entries`.`status` = 0 AND 1=0\n Rendering entries/parkings/index.html.erb\n Rendered collection of entries/parkings/_entry.html.erb [0 times] (Duration: 0.1ms | Allocations: 25)\n Rendered entries/parkings/index.html.erb (Duration: 0.4ms | Allocations: 265)\nCompleted 200 OK in 14ms (Views: 0.6ms | ActiveRecord: 4.0ms | Elasticsearch: 0.0ms | Allocations: 12790)\n""}"
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2580907 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2580907 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 2580907 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 88784319 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 88784319 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 88784319 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87246737 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87246737 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 95489) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 95489 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87246737 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93204111 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93204111 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93204111 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12881316 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12881316 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12881316 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93204111 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93204111 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93204111 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12881316 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12881316 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67641) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67641 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 12881316 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 113027709 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 113027709 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2022-10-31 17:26:16' AND `postings`.`id` < 466687817 OR `postings`.`active_at` < '2022-10-31 17:26:16') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 270534) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 270534 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21308352 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 270534) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 270534 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21308352 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 270534) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 270534 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 21308352 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 113027709 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 113027709 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-08-18 18:55:06' AND `postings`.`id` < 622717707 OR `postings`.`active_at` < '2023-08-18 18:55:06') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-08-18 18:55:06' AND `postings`.`id` < 622717707 OR `postings`.`active_at` < '2023-08-18 18:55:06') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2022-11-10 00:07:28' AND `postings`.`id` < 472056798 OR `postings`.`active_at` < '2022-11-10 00:07:28') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 77638) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 77638 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (2221312, 2224852, 2225040, 119468319) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 77638) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 77638 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (2221312, 2224852, 2225040, 119468319) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 11592) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 11592 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 365459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 11592) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 11592 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 365459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 11592) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 11592 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 365459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 108401025 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 108401025 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2022-10-31 17:26:16' AND `postings`.`id` < 466687817 OR `postings`.`active_at` < '2022-10-31 17:26:16') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 108401025 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 108401025 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2022-11-10 00:07:28' AND `postings`.`id` < 472056798 OR `postings`.`active_at` < '2022-11-10 00:07:28') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 10039) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 10039 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 399173 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 10039) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 10039 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 399173 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 10039) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 10039 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 399173 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-08-18 18:55:06' AND `postings`.`id` < 622717707 OR `postings`.`active_at` < '2023-08-18 18:55:06') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-08-18 18:55:06' AND `postings`.`id` < 622717707 OR `postings`.`active_at` < '2023-08-18 18:55:06') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-07-26 03:45:11' AND `postings`.`id` < 610464423 OR `postings`.`active_at` < '2023-07-26 03:45:11') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-07-26 03:45:11' AND `postings`.`id` < 610464423 OR `postings`.`active_at` < '2023-07-26 03:45:11') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 513296) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 513296 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80404804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 30019) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 30019 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80775358 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 30019) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 30019 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 80775358 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (108401025, 113027709) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (108401025, 113027709) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (108401025, 113027709) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 322757) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 322757 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (108401025, 113027709) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-03-31 18:52:09' AND `postings`.`id` < 549177991 OR `postings`.`active_at` < '2023-03-31 18:52:09') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-03-31 18:52:09' AND `postings`.`id` < 549177991 OR `postings`.`active_at` < '2023-03-31 18:52:09') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-17 12:30:13' AND `postings`.`id` < 654014918 OR `postings`.`active_at` < '2023-10-17 12:30:13') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2022-11-10 00:07:28' AND `postings`.`id` < 472056798 OR `postings`.`active_at` < '2022-11-10 00:07:28') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-26 09:03:32' AND `postings`.`id` < 658804438 OR `postings`.`active_at` < '2023-10-26 09:03:32') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8196) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8196 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33965695 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8196) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8196 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33965695 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 8196) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 8196 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 33965695 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-07-26 03:45:11' AND `postings`.`id` < 610464423 OR `postings`.`active_at` < '2023-07-26 03:45:11') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-04-12 14:27:45' AND `postings`.`id` < 550423716 OR `postings`.`active_at` < '2023-04-12 14:27:45') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-04-12 14:27:45' AND `postings`.`id` < 550423716 OR `postings`.`active_at` < '2023-04-12 14:27:45') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48020) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48020 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118584876 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 48020) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 48020 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 118584876 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 67358) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 67358 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93216905 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 133186) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 133186 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (67369403, 118264785, 67369387) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 305654) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 305654 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 29720558 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-09-20 18:11:45' AND `postings`.`id` < 639258582 OR `postings`.`active_at` < '2023-09-20 18:11:45') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 305654) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 305654 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 29720558 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 558416) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 558416 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 85043979 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 558416) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 558416 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 85043979 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 45285) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 45285 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 40616474 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 45285) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 45285 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 40616474 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 45285) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 45285 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 40616474 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 558416) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 558416 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 85043979 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 558416) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 558416 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 85043979 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54990502 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54990502 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 72859) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 72859 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 111732103 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 72859) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 72859 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 111732103 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 72859) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 72859 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 111732103 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69058) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69058 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56827804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69058) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69058 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56827804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69058) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69058 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56827804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 102635078 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 102635078 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-17 12:30:13' AND `postings`.`id` < 654014918 OR `postings`.`active_at` < '2023-10-17 12:30:13') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-17 12:30:13' AND `postings`.`id` < 654014918 OR `postings`.`active_at` < '2023-10-17 12:30:13') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 333292) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 333292 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 46308241 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 333292) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 333292 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 46308241 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 333292) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 333292 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 46308241 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-26 09:03:32' AND `postings`.`id` < 658804438 OR `postings`.`active_at` < '2023-10-26 09:03:32') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-10-26 09:03:32' AND `postings`.`id` < 658804438 OR `postings`.`active_at` < '2023-10-26 09:03:32') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 167905) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 167905 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8607731 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 18315) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 18315 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 94239406 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 18315) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 18315 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 94239406 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 320314) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 320314 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 82279752 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 320314) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 320314 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 82279752 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19888) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19888 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 75837332 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19888) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19888 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 75837332 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19888) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19888 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 75837332 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 105027462 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 105027462 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 49797) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 49797 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 35333119 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 49797) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 49797 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 35333119 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 49797) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 49797 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 35333119 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 49797) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 49797 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 27007264 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 49797) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 49797 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 27007264 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 49797) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 49797 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 27007264 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 318746) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 318746 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116124298 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 318746) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 318746 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116124298 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2022-11-10 00:07:28' AND `postings`.`id` < 472056798 OR `postings`.`active_at` < '2022-11-10 00:07:28') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-07-26 03:45:11' AND `postings`.`id` < 610464423 OR `postings`.`active_at` < '2023-07-26 03:45:11') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-07-26 03:45:11' AND `postings`.`id` < 610464423 OR `postings`.`active_at` < '2023-07-26 03:45:11') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 75169) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 75169 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87833811 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 75169) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 75169 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 87833811 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 9170) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 9170 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 54927836 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 318209) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 318209 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 49958476 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 318209) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 318209 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 49958476 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 318209) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 318209 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 49958476 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 23672) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 23672 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 44911204 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 23672) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 23672 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 44911204 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 23672) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 23672 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 44911204 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 672676) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 672676 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (115096173, 115427375, 115775591, 115791585, 115791593, 116663672, 117279853, 118899166, 119731016) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 672676) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 672676 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (115096173, 115427375, 115775591, 115791585, 115791593, 116663672, 117279853, 118899166, 119731016) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 672676) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 672676 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (115096173, 115427375, 115775591, 115791585, 115791593, 116663672, 117279853, 118899166, 119731016) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 18315) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 18315 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 92387320 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 18315) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 18315 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 92387320 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 192753) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 192753 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (102862475, 119182090, 119261784) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 311341) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 311341 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 52220444 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 311341) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 311341 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 52220444 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 311341) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 311341 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 52220444 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 672676) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 672676 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116663672 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 672676) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 672676 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 116663672 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69058) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69058 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56827804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69058) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69058 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56827804 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 69058) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 69058 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 56827804 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 45190) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 45190 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 49901403 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 45190) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 45190 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 49901403 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 45190) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 45190 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 49901403 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 158400) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 158400 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8503517 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 158400) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 158400 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8503517 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 158400) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 158400 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 8503517 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 340388) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 340388 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84884082 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 340388) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 340388 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84884082 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 340388) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 340388 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84884082 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 69763506 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 69763506 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 69763506 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 46762) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 46762 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 83496578 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 46762) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 46762 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 83496578 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 46762) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 46762 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 83496578 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 18315) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 18315 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 97221849 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 18315) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 18315 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 97221849 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 298555) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 298555 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31375690 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 298555) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 298555 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31375690 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 298555) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 298555 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31375690 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 312171) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 312171 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 30935070 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 312171) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 312171 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 30935070 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 312171) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 312171 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 30935070 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-11-02 15:42:43' AND `postings`.`id` < 662848763 OR `postings`.`active_at` < '2023-11-02 15:42:43') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-11-02 15:42:43' AND `postings`.`id` < 662848763 OR `postings`.`active_at` < '2023-11-02 15:42:43') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-11-03 10:24:47' AND `postings`.`id` < 663299036 OR `postings`.`active_at` < '2023-11-03 10:24:47') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`) AND (`postings`.`active_at` = '2023-11-03 10:24:47' AND `postings`.`id` < 663299036 OR `postings`.`active_at` < '2023-11-03 10:24:47') ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 165928) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 165928 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (118569344, 119439752) AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 30
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 165928) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 165928 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` IN (118569344, 119439752) AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 667222) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 667222 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 112616375 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 329690) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 329690 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 36108177 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 329690) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 329690 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 36108177 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 329690) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 329690 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 36108177 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77760390 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77760390 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 4810) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 4810 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 77760390 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 69763506 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 69763506 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 69763506 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31460528 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31460528 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19786) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19786 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 31460528 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19537) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19537 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 746852 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19537) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19537 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 746852 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 19537) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 19537 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 746852 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 5455) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 5455 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120333380 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 5455) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 5455 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120333380 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 21419) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 21419 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 120401674 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 93425459 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 83942) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 83942 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 58684430 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 83942) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 83942 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 58684430 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 83942) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 83942 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 58684430 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 27532828 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 27532828 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 27532828 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84954100 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10
SELECT COUNT(DISTINCT `postings`.`id`) FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84954100 AND (`users`.`account_id` = `involvements`.`account_id`)
SELECT DISTINCT `postings`.`id`, `postings`.`active_at` FROM `postings` USE INDEX (index_postings_on_user_id_and_postable_and_active_at) STRAIGHT_JOIN `involvements` USE INDEX(index_involvements_on_account_id_and_topic_id_and_contact_id) ON `involvements`.`topic_id` = `postings`.`postable_id` INNER JOIN `users` ON `users`.`id` = `postings`.`user_id` WHERE `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` WHERE `users`.`identity_id` = 51671) AND `postings`.`user_id` IN (SELECT `users`.`id` FROM `users` INNER JOIN `accounts` ON `accounts`.`id` = `users`.`account_id` WHERE `users`.`identity_id` = 51671 AND (`accounts`.`status` = 0 OR `accounts`.`purpose` = 2 AND `accounts`.`status` = 1)) AND `postings`.`postable_type` = 'Topic' AND `involvements`.`contact_id` = 84954100 AND (`users`.`account_id` = `involvements`.`account_id`) ORDER BY `postings`.`active_at` DESC, `postings`.`id` DESC LIMIT 10

View File

@@ -7,7 +7,7 @@ class CliAccessoryTest < CliTestCase
run_command("boot", "mysql").tap do |output|
assert_match /docker login.*on 1.1.1.3/, output
assert_match "docker run --name app-mysql --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 3306:3306 --env-file .kamal/env/accessories/app-mysql.env --env MYSQL_ROOT_HOST=\"%\" --volume $PWD/app-mysql/etc/mysql/my.cnf:/etc/mysql/my.cnf --volume $PWD/app-mysql/data:/var/lib/mysql --label service=\"app-mysql\" mysql:5.7 on 1.1.1.3", output
assert_match "docker run --name app-mysql --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 3306:3306 --env-file .kamal/env/accessories/app-mysql.env --volume $PWD/app-mysql/etc/mysql/my.cnf:/etc/mysql/my.cnf --volume $PWD/app-mysql/data:/var/lib/mysql --label service=\"app-mysql\" mysql:5.7 on 1.1.1.3", output
end
end
@@ -21,7 +21,7 @@ class CliAccessoryTest < CliTestCase
assert_match /docker login.*on 1.1.1.3/, output
assert_match /docker login.*on 1.1.1.1/, output
assert_match /docker login.*on 1.1.1.2/, output
assert_match "docker run --name app-mysql --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 3306:3306 --env-file .kamal/env/accessories/app-mysql.env --env MYSQL_ROOT_HOST=\"%\" --volume $PWD/app-mysql/etc/mysql/my.cnf:/etc/mysql/my.cnf --volume $PWD/app-mysql/data:/var/lib/mysql --label service=\"app-mysql\" mysql:5.7 on 1.1.1.3", output
assert_match "docker run --name app-mysql --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 3306:3306 --env-file .kamal/env/accessories/app-mysql.env --volume $PWD/app-mysql/etc/mysql/my.cnf:/etc/mysql/my.cnf --volume $PWD/app-mysql/data:/var/lib/mysql --label service=\"app-mysql\" mysql:5.7 on 1.1.1.3", output
assert_match "docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume $PWD/app-redis/data:/data --label service=\"app-redis\" redis:latest on 1.1.1.1", output
assert_match "docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume $PWD/app-redis/data:/data --label service=\"app-redis\" redis:latest on 1.1.1.2", output
end
@@ -79,10 +79,6 @@ class CliAccessoryTest < CliTestCase
assert_match "docker ps --filter label=service=app-mysql", run_command("details", "mysql")
end
test "details with non-existent accessory" do
assert_equal "No accessory by the name of 'hello' (options: mysql and redis)", stderred { run_command("details", "hello") }
end
test "details with all" do
run_command("details", "all").tap do |output|
assert_match "docker ps --filter label=service=app-mysql", output
@@ -152,30 +148,6 @@ class CliAccessoryTest < CliTestCase
assert_match "rm -rf app-mysql", run_command("remove_service_directory", "mysql")
end
test "hosts param respected" do
Kamal::Cli::Accessory.any_instance.expects(:directories).with("redis")
Kamal::Cli::Accessory.any_instance.expects(:upload).with("redis")
run_command("boot", "redis", "--hosts", "1.1.1.1").tap do |output|
assert_match /docker login.*on 1.1.1.1/, output
assert_no_match /docker login.*on 1.1.1.2/, output
assert_match "docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume $PWD/app-redis/data:/data --label service=\"app-redis\" redis:latest on 1.1.1.1", output
assert_no_match "docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume $PWD/app-redis/data:/data --label service=\"app-redis\" redis:latest on 1.1.1.2", output
end
end
test "hosts param intersected with configuration" do
Kamal::Cli::Accessory.any_instance.expects(:directories).with("redis")
Kamal::Cli::Accessory.any_instance.expects(:upload).with("redis")
run_command("boot", "redis", "--hosts", "1.1.1.1,1.1.1.3").tap do |output|
assert_match /docker login.*on 1.1.1.1/, output
assert_no_match /docker login.*on 1.1.1.3/, output
assert_match "docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume $PWD/app-redis/data:/data --label service=\"app-redis\" redis:latest on 1.1.1.1", output
assert_no_match "docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume $PWD/app-redis/data:/data --label service=\"app-redis\" redis:latest on 1.1.1.3", output
end
end
private
def run_command(*command)
stdouted { Kamal::Cli::Accessory.start([*command, "-c", "test/fixtures/deploy_with_accessories.yml"]) }

View File

@@ -23,11 +23,11 @@ class CliAppTest < CliTestCase
.returns("running") # health check
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:sh, "-c", "'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting'", "|", :head, "-1", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.with(:docker, :ps, "--filter", "label=service=app", "--filter", "label=role=web", "--filter", "status=running", "--filter", "status=restarting", "--latest", "--format", "\"{{.Names}}\"", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("123") # old version
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", "app-web-123", "|", :awk, "'$2 == \"/tmp/kamal-cord\" {print $1}'", raise_on_non_zero_exit: false)
.with(:docker, :inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", "app-web-123", "|", :awk, "'$2 == \"/tmp/kamal-cord\" {print $1}'", :raise_on_non_zero_exit => false)
.returns("cordfile") # old version
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
@@ -45,7 +45,7 @@ class CliAppTest < CliTestCase
end
test "boot uses group strategy when specified" do
Kamal::Cli::App.any_instance.stubs(:on).with("1.1.1.1").times(3) # ensure locks dir, acquire & release lock
Kamal::Cli::App.any_instance.stubs(:on).with("1.1.1.1").twice # acquire & release lock
Kamal::Cli::App.any_instance.stubs(:on).with([ "1.1.1.1" ]) # tag container
# Strategy is used when booting the containers
@@ -57,7 +57,7 @@ class CliAppTest < CliTestCase
test "boot errors leave lock in place" do
Kamal::Cli::App.any_instance.expects(:using_version).raises(RuntimeError)
assert_not KAMAL.holding_lock?
assert !KAMAL.holding_lock?
assert_raises(RuntimeError) do
stderred { run_command("boot") }
end
@@ -75,11 +75,11 @@ class CliAppTest < CliTestCase
.returns("running") # health check
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:sh, "-c", "'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting'", "|", :head, "-1", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.with(:docker, :ps, "--filter", "label=service=app", "--filter", "label=role=web", "--filter", "status=running", "--filter", "status=restarting", "--latest", "--format", "\"{{.Names}}\"", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("123").twice # old version
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", "app-web-123", "|", :awk, "'$2 == \"/tmp/kamal-cord\" {print $1}'", raise_on_non_zero_exit: false)
.with(:docker, :inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", "app-web-123", "|", :awk, "'$2 == \"/tmp/kamal-cord\" {print $1}'", :raise_on_non_zero_exit => false)
.returns("") # old version
run_command("boot", config: :with_assets).tap do |output|
@@ -100,18 +100,14 @@ class CliAppTest < CliTestCase
test "stop" do
run_command("stop").tap do |output|
assert_match "sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker stop", output
assert_match "docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker stop", output
end
end
test "stale_containers" do
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :ps, "--filter", "label=service=app", "--filter", "label=role=web", "--format", "\"{{.Names}}\"", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("12345678\n87654321\n")
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:sh, "-c", "'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting'", "|", :head, "-1", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("12345678\n")
.returns("12345678\n87654321")
run_command("stale_containers").tap do |output|
assert_match /Detected stale container for role web with version 87654321/, output
@@ -121,11 +117,7 @@ class CliAppTest < CliTestCase
test "stop stale_containers" do
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :ps, "--filter", "label=service=app", "--filter", "label=role=web", "--format", "\"{{.Names}}\"", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("12345678\n87654321\n")
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:sh, "-c", "'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting'", "|", :head, "-1", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("12345678\n")
.returns("12345678\n87654321")
run_command("stale_containers", "--stop").tap do |output|
assert_match /Stopping stale container for role web with version 87654321/, output
@@ -141,7 +133,7 @@ class CliAppTest < CliTestCase
test "remove" do
run_command("remove").tap do |output|
assert_match /#{Regexp.escape("sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker stop")}/, output
assert_match /#{Regexp.escape("docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker stop")}/, output
assert_match /#{Regexp.escape("docker container prune --force --filter label=service=app")}/, output
assert_match /#{Regexp.escape("docker image prune --all --force --filter label=service=app")}/, output
end
@@ -173,7 +165,7 @@ class CliAppTest < CliTestCase
test "exec with reuse" do
run_command("exec", "--reuse", "ruby -v").tap do |output|
assert_match "sh -c 'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | while read line; do echo ${line#app-web-}; done", output # Get current version
assert_match "docker ps --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest --format \"{{.Names}}\" | while read line; do echo ${line#app-web-}; done", output # Get current version
assert_match "docker exec app-web-999 ruby -v", output
end
end
@@ -192,7 +184,7 @@ class CliAppTest < CliTestCase
.with("ssh -t root@1.1.1.1 -p 22 'docker exec -it app-web-999 ruby -v'")
run_command("exec", "-i", "--reuse", "ruby -v").tap do |output|
assert_match "Get current version of running container...", output
assert_match "Running /usr/bin/env sh -c 'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | while read line; do echo ${line#app-web-}; done on 1.1.1.1", output
assert_match "Running docker ps --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest --format \"{{.Names}}\" | while read line; do echo ${line#app-web-}; done on 1.1.1.1", output
assert_match "Launching interactive command with version 999 via SSH from existing container on 1.1.1.1...", output
end
end
@@ -211,28 +203,28 @@ class CliAppTest < CliTestCase
test "logs" do
SSHKit::Backend::Abstract.any_instance.stubs(:exec)
.with("ssh -t root@1.1.1.1 'sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1| xargs docker logs --timestamps --tail 10 2>&1'")
.with("ssh -t root@1.1.1.1 'docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest| xargs docker logs --timestamps --tail 10 2>&1'")
assert_match "sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --tail 100 2>&1", run_command("logs")
assert_match "docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --tail 100 2>&1", run_command("logs")
end
test "logs with follow" do
SSHKit::Backend::Abstract.any_instance.stubs(:exec)
.with("ssh -t root@1.1.1.1 -p 22 'sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --tail 10 --follow 2>&1'")
.with("ssh -t root@1.1.1.1 -p 22 'docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --timestamps --tail 10 --follow 2>&1'")
assert_match "sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --tail 10 --follow 2>&1", run_command("logs", "--follow")
assert_match "docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --timestamps --tail 10 --follow 2>&1", run_command("logs", "--follow")
end
test "version" do
run_command("version").tap do |output|
assert_match "sh -c 'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | while read line; do echo ${line#app-web-}; done", output
assert_match "docker ps --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest --format \"{{.Names}}\" | while read line; do echo ${line#app-web-}; done", output
end
end
test "version through main" do
stdouted { Kamal::Cli::Main.start(["app", "version", "-c", "test/fixtures/deploy_with_accessories.yml", "--hosts", "1.1.1.1"]) }.tap do |output|
assert_match "sh -c 'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | while read line; do echo ${line#app-web-}; done", output
assert_match "docker ps --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest --format \"{{.Names}}\" | while read line; do echo ${line#app-web-}; done", output
end
end

View File

@@ -12,10 +12,10 @@ class CliBuildTest < CliTestCase
Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true)
hook_variables = { version: 999, service_version: "app@999", hosts: "1.1.1.1,1.1.1.2,1.1.1.3,1.1.1.4", command: "build", subcommand: "push" }
run_command("push", "--verbose").tap do |output|
run_command("push").tap do |output|
assert_hook_ran "pre-build", output, **hook_variables
assert_match /docker --version && docker buildx version/, output
assert_match /git archive -tar HEAD | docker buildx build --push --platform linux\/amd64,linux\/arm64 --builder kamal-app-multiarch -t dhh\/app:999 -t dhh\/app:latest --label service="app" --file Dockerfile - as .*@localhost/, output
assert_match /docker buildx build --push --platform linux\/amd64,linux\/arm64 --builder kamal-app-multiarch -t dhh\/app:999 -t dhh\/app:latest --label service="app" --file Dockerfile \. as .*@localhost/, output
end
end
@@ -25,10 +25,7 @@ class CliBuildTest < CliTestCase
.with(:docker, "--version", "&&", :docker, :buildx, "version")
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with(:docker, :buildx, :create, "--use", "--name", "kamal-app-multiarch")
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |*args| p args[0..6]; args[0..6] == [ :git, :archive, "--format=tar", :HEAD, "|", :docker, :buildx ] }
.with { |*args| args[0..1] == [:docker, :buildx] }
.raises(SSHKit::Command::Failed.new("no builder"))
.then
.returns(true)
@@ -51,8 +48,7 @@ class CliBuildTest < CliTestCase
test "push pre-build hook failure" do
fail_hook("pre-build")
error = assert_raises(Kamal::Cli::HookError) { run_command("push") }
assert_equal "Hook `pre-build` failed:\nfailed", error.message
assert_raises(Kamal::Cli::HookError) { run_command("push") }
assert @executions.none? { |args| args[0..2] == [:docker, :buildx, :build] }
end
@@ -61,7 +57,7 @@ class CliBuildTest < CliTestCase
run_command("pull").tap do |output|
assert_match /docker image rm --force dhh\/app:999/, output
assert_match /docker pull dhh\/app:999/, output
assert_match "docker inspect -f '{{ .Config.Labels.service }}' dhh/app:999 | grep -x app || (echo \"Image dhh/app:999 is missing the 'service' label\" && exit 1)", output
assert_match "docker inspect -f '{{ .Config.Labels.service }}' dhh/app:999 | grep -x app || (echo \"Image dhh/app:999 is missing the `service` label\" && exit 1)", output
end
end

View File

@@ -31,14 +31,12 @@ class CliTestCase < ActiveSupport::TestCase
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |*args| args == [ :mkdir, "-p", ".kamal" ] }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |arg1, arg2, arg3| arg1 == :mkdir && arg2 == "-p" && arg3 == ".kamal/locks" }
.with { |arg1, arg2| arg1 == :mkdir && arg2 == ".kamal/lock-app" }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |arg1, arg2| arg1 == :mkdir && arg2 == ".kamal/locks/app" }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |arg1, arg2| arg1 == :rm && arg2 == ".kamal/locks/app/details" }
.with { |arg1, arg2| arg1 == :rm && arg2 == ".kamal/lock-app/details" }
end
def assert_hook_ran(hook, output, version:, service_version:, hosts:, command:, subcommand: nil, runtime: false)
def assert_hook_ran(hook, output, version:, service_version:, hosts:, command:, subcommand: nil, runtime: nil)
performer = `whoami`.strip
assert_match "Running the #{hook} hook...\n", output
@@ -52,7 +50,7 @@ class CliTestCase < ActiveSupport::TestCase
KAMAL_HOSTS=\"#{hosts}\"\s
KAMAL_COMMAND=\"#{command}\"\s
#{"KAMAL_SUBCOMMAND=\\\"#{subcommand}\\\"\\s" if subcommand}
#{"KAMAL_RUNTIME=\\\"\\d+\\\"\\s" if runtime}
#{"KAMAL_RUNTIME=\\\"#{runtime}\\\"\\s" if runtime}
;\s/usr/bin/env\s\.kamal/hooks/#{hook} }x
assert_match expected, output

View File

@@ -13,6 +13,7 @@ class CliEnvTest < CliTestCase
assert_match ".kamal/env/roles/app-workers.env", output
assert_match ".kamal/env/traefik/traefik.env", output
assert_match ".kamal/env/accessories/app-redis.env", output
end
end

View File

@@ -3,7 +3,7 @@ require_relative "cli_test_case"
class CliLockTest < CliTestCase
test "status" do
run_command("status").tap do |output|
assert_match "Running /usr/bin/env stat .kamal/locks/app > /dev/null && cat .kamal/locks/app/details | base64 -d on 1.1.1.1", output
assert_match "Running /usr/bin/env stat .kamal/lock-app > /dev/null && cat .kamal/lock-app/details | base64 -d on 1.1.1.1", output
end
end

View File

@@ -2,51 +2,16 @@ require_relative "cli_test_case"
class CliMainTest < CliTestCase
test "setup" do
invoke_options = { "config_file" => "test/fixtures/deploy_simple.yml", "version" => "999", "skip_hooks" => false }
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:server:bootstrap", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:env:push", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:accessory:boot", [ "all" ], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:server:bootstrap")
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:env:push")
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:accessory:boot", [ "all" ])
Kamal::Cli::Main.any_instance.expects(:deploy)
run_command("setup").tap do |output|
assert_match /Ensure Docker is installed.../, output
assert_match /Push env files.../, output
end
end
test "setup with skip_push" do
invoke_options = { "config_file" => "test/fixtures/deploy_simple.yml", "version" => "999", "skip_hooks" => false }
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:server:bootstrap", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:env:push", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:accessory:boot", [ "all" ], invoke_options)
# deploy
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:registry:login", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:build:pull", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:traefik:boot", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:healthcheck:perform", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:app:stale_containers", [], invoke_options.merge(stop: true))
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:app:boot", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:prune:all", [], invoke_options)
run_command("setup", "--skip_push").tap do |output|
assert_match /Ensure Docker is installed.../, output
assert_match /Push env files.../, output
# deploy
assert_match /Acquiring the deploy lock/, output
assert_match /Log into image registry/, output
assert_match /Pull app image/, output
assert_match /Ensure Traefik is running/, output
assert_match /Ensure app can pass healthcheck/, output
assert_match /Detect stale containers/, output
assert_match /Prune old containers and images/, output
assert_match /Releasing the deploy lock/, output
end
run_command("setup")
end
test "deploy" do
invoke_options = { "config_file" => "test/fixtures/deploy_simple.yml", "version" => "999", "skip_hooks" => false, "verbose" => true }
invoke_options = { "config_file" => "test/fixtures/deploy_simple.yml", "version" => "999", "skip_hooks" => false }
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:registry:login", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:build:deliver", [], invoke_options)
@@ -59,7 +24,7 @@ class CliMainTest < CliTestCase
Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true)
hook_variables = { version: 999, service_version: "app@999", hosts: "1.1.1.1,1.1.1.2", command: "deploy" }
run_command("deploy", "--verbose").tap do |output|
run_command("deploy").tap do |output|
assert_hook_ran "pre-connect", output, **hook_variables
assert_match /Log into image registry/, output
assert_match /Build and push app image/, output
@@ -68,7 +33,7 @@ class CliMainTest < CliTestCase
assert_match /Ensure app can pass healthcheck/, output
assert_match /Detect stale containers/, output
assert_match /Prune old containers and images/, output
assert_hook_ran "post-deploy", output, **hook_variables, runtime: true
assert_hook_ran "post-deploy", output, **hook_variables, runtime: 0
end
end
@@ -102,14 +67,11 @@ class CliMainTest < CliTestCase
.with { |*args| args == [ :mkdir, "-p", ".kamal" ] }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |*args| args == [ :mkdir, "-p", ".kamal/locks" ] }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |*arg| arg[0..1] == [ :mkdir, ".kamal/locks/app" ] }
.raises(RuntimeError, "mkdir: cannot create directory kamal/locks/app: File exists")
.with { |*arg| arg[0..1] == [:mkdir, ".kamal/lock-app"] }
.raises(RuntimeError, "mkdir: cannot create directory kamal_lock-app: File exists")
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_debug)
.with(:stat, ".kamal/locks/app", ">", "/dev/null", "&&", :cat, ".kamal/locks/app/details", "|", :base64, "-d")
.with(:stat, ".kamal/lock-app", ">", "/dev/null", "&&", :cat, ".kamal/lock-app/details", "|", :base64, "-d")
assert_raises(Kamal::Cli::LockError) do
run_command("deploy")
@@ -123,10 +85,7 @@ class CliMainTest < CliTestCase
.with { |*args| args == [ :mkdir, "-p", ".kamal" ] }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |*args| args == [ :mkdir, "-p", ".kamal/locks" ] }
SSHKit::Backend::Abstract.any_instance.stubs(:execute)
.with { |*arg| arg[0..1] == [ :mkdir, ".kamal/locks/app" ] }
.with { |*arg| arg[0..1] == [:mkdir, ".kamal/lock-app"] }
.raises(SocketError, "getaddrinfo: nodename nor servname provided, or not known")
assert_raises(SSHKit::Runner::ExecuteError) do
@@ -141,11 +100,11 @@ class CliMainTest < CliTestCase
.with("kamal:cli:registry:login", [], invoke_options)
.raises(RuntimeError)
assert_not KAMAL.holding_lock?
assert !KAMAL.holding_lock?
assert_raises(RuntimeError) do
stderred { run_command("deploy") }
end
assert_not KAMAL.holding_lock?
assert !KAMAL.holding_lock?
end
test "deploy with skipped hooks" do
@@ -160,7 +119,7 @@ class CliMainTest < CliTestCase
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:prune:all", [], invoke_options)
run_command("deploy", "--skip_hooks") do
assert_no_match /Running the post-deploy hook.../, output
refute_match /Running the post-deploy hook.../, output
end
end
@@ -194,7 +153,7 @@ class CliMainTest < CliTestCase
end
test "redeploy" do
invoke_options = { "config_file" => "test/fixtures/deploy_simple.yml", "version" => "999", "skip_hooks" => false, "verbose" => true }
invoke_options = { "config_file" => "test/fixtures/deploy_simple.yml", "version" => "999", "skip_hooks" => false }
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:build:deliver", [], invoke_options)
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:healthcheck:perform", [], invoke_options)
@@ -205,13 +164,13 @@ class CliMainTest < CliTestCase
hook_variables = { version: 999, service_version: "app@999", hosts: "1.1.1.1,1.1.1.2", command: "redeploy" }
run_command("redeploy", "--verbose").tap do |output|
run_command("redeploy").tap do |output|
assert_hook_ran "pre-connect", output, **hook_variables
assert_match /Build and push app image/, output
assert_hook_ran "pre-deploy", output, **hook_variables
assert_match /Running the pre-deploy hook.../, output
assert_match /Ensure app can pass healthcheck/, output
assert_hook_ran "post-deploy", output, **hook_variables, runtime: true
assert_hook_ran "post-deploy", output, **hook_variables, runtime: "0"
end
end
@@ -250,7 +209,7 @@ class CliMainTest < CliTestCase
.with(:docker, :container, :ls, "--all", "--filter", "name=^app-#{role}-123$", "--quiet")
.returns("version-to-rollback\n").at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:sh, "-c", "'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=#{role} --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=#{role} --filter status=running --filter status=restarting'", "|", :head, "-1", "|", "while read line; do echo ${line#app-#{role}-}; done", raise_on_non_zero_exit: false)
.with(:docker, :ps, "--filter", "label=service=app", "--filter", "label=role=#{role}", "--filter", "status=running", "--filter", "status=restarting", "--latest", "--format", "\"{{.Names}}\"", "|", "while read line; do echo ${line#app-#{role}-}; done", raise_on_non_zero_exit: false)
.returns("version-to-rollback\n").at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :container, :ls, "--all", "--filter", "name=^app-#{role}-123$", "--quiet", "|", :xargs, :docker, :inspect, "--format", "'{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'")
@@ -258,7 +217,7 @@ class CliMainTest < CliTestCase
end
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", "app-web-version-to-rollback", "|", :awk, "'$2 == \"/tmp/kamal-cord\" {print $1}'", raise_on_non_zero_exit: false)
.with(:docker, :inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", "app-web-version-to-rollback", "|", :awk, "'$2 == \"/tmp/kamal-cord\" {print $1}'", :raise_on_non_zero_exit => false)
.returns("corddirectory").at_least_once # health check
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
@@ -268,12 +227,12 @@ class CliMainTest < CliTestCase
Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true)
hook_variables = { version: 123, service_version: "app@123", hosts: "1.1.1.1,1.1.1.2,1.1.1.3,1.1.1.4", command: "rollback" }
run_command("rollback", "--verbose", "123", config_file: "deploy_with_accessories").tap do |output|
run_command("rollback", "123", config_file: "deploy_with_accessories").tap do |output|
assert_hook_ran "pre-deploy", output, **hook_variables
assert_match "docker tag dhh/app:123 dhh/app:latest", output
assert_match "docker run --detach --restart unless-stopped --name app-web-123", output
assert_match "docker container ls --all --filter name=^app-web-version-to-rollback$ --quiet | xargs docker stop", output, "Should stop the container that was previously running"
assert_hook_ran "post-deploy", output, **hook_variables, runtime: true
assert_hook_ran "post-deploy", output, **hook_variables, runtime: "0"
end
end
@@ -286,7 +245,7 @@ class CliMainTest < CliTestCase
.with(:docker, :container, :ls, "--all", "--filter", "name=^app-web-123$", "--quiet", raise_on_non_zero_exit: false)
.returns("").at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:sh, "-c", "'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting'", "|", :head, "-1", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.with(:docker, :ps, "--filter", "label=service=app", "--filter", "label=role=web", "--filter", "status=running", "--filter", "status=restarting", "--latest", "--format", "\"{{.Names}}\"", "|", "while read line; do echo ${line#app-web-}; done", raise_on_non_zero_exit: false)
.returns("").at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:capture_with_info)
.with(:docker, :container, :ls, "--all", "--filter", "name=^app-web-123$", "--quiet", "|", :xargs, :docker, :inspect, "--format", "'{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'")

View File

@@ -20,15 +20,6 @@ class CliPruneTest < CliTestCase
assert_match /docker ps -q -a --filter label=service=app --filter status=created --filter status=exited --filter status=dead | tail -n +6 | while read container_id; do docker rm $container_id; done on 1.1.1.\d/, output
assert_match /docker container prune --force --filter label=service=healthcheck-app on 1.1.1.\d/, output
end
run_command("containers", "--retain", "10").tap do |output|
assert_match /docker ps -q -a --filter label=service=app --filter status=created --filter status=exited --filter status=dead | tail -n +11 | while read container_id; do docker rm $container_id; done on 1.1.1.\d/, output
assert_match /docker container prune --force --filter label=service=healthcheck-app on 1.1.1.\d/, output
end
assert_raises(RuntimeError, "retain must be at least 1") do
run_command("containers", "--retain", "0")
end
end
private

View File

@@ -21,15 +21,12 @@ class CliServerTest < CliTestCase
test "bootstrap install as root user" do
SSHKit::Backend::Abstract.any_instance.expects(:execute).with(:docker, "-v", raise_on_non_zero_exit: false).returns(false).at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:execute).with('[ "${EUID:-$(id -u)}" -eq 0 ] || command -v sudo >/dev/null || command -v su >/dev/null', raise_on_non_zero_exit: false).returns(true).at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:execute).with(:sh, "-c", "'curl -fsSL https://get.docker.com || wget -O - https://get.docker.com || echo \"exit 1\"'", "|", :sh).at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:execute).with(:curl, "-fsSL", "https://get.docker.com", "|", :sh).at_least_once
SSHKit::Backend::Abstract.any_instance.expects(:execute).with(:mkdir, "-p", ".kamal").returns("").at_least_once
Kamal::Commands::Hook.any_instance.stubs(:hook_exists?).returns(true)
SSHKit::Backend::Abstract.any_instance.expects(:execute).with(".kamal/hooks/docker-setup", anything).at_least_once
run_command("bootstrap").tap do |output|
("1.1.1.1".."1.1.1.4").map do |host|
assert_match "Missing Docker on #{host}. Installing…", output
assert_match "Running the docker-setup hook", output
end
end
end

View File

@@ -11,7 +11,7 @@ class CliTraefikTest < CliTestCase
test "reboot" do
Kamal::Commands::Registry.any_instance.expects(:login).twice
run_command("reboot", "-y").tap do |output|
run_command("reboot").tap do |output|
assert_match "docker container stop traefik", output
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=Traefik", output
assert_match "docker run --name traefik --detach --restart unless-stopped --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --env-file .kamal/env/traefik/traefik.env --log-opt max-size=\"10m\" --label traefik.http.routers.catchall.entryPoints=\"http\" --label traefik.http.routers.catchall.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.catchall.service=\"unavailable\" --label traefik.http.routers.catchall.priority=\"1\" --label traefik.http.services.unavailable.loadbalancer.server.port=\"0\" #{Kamal::Commands::Traefik::DEFAULT_IMAGE} --providers.docker --log.level=\"DEBUG\"", output
@@ -21,7 +21,7 @@ class CliTraefikTest < CliTestCase
test "reboot --rolling" do
Object.any_instance.stubs(:sleep)
run_command("reboot", "--rolling", "-y").tap do |output|
run_command("reboot", "--rolling").tap do |output|
assert_match "Running docker container prune --force --filter label=org.opencontainers.image.title=Traefik on 1.1.1.1", output
end
end

View File

@@ -24,10 +24,8 @@ class CommanderTest < ActiveSupport::TestCase
@kamal.specific_hosts = [ "*" ]
assert_equal [ "1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4" ], @kamal.hosts
exception = assert_raises(ArgumentError) do
@kamal.specific_hosts = [ "*miss" ]
end
assert_match /hosts match for \*miss/, exception.message
assert_equal [], @kamal.hosts
end
test "filtering hosts by filtering roles" do
@@ -35,11 +33,6 @@ class CommanderTest < ActiveSupport::TestCase
@kamal.specific_roles = [ "web" ]
assert_equal [ "1.1.1.1", "1.1.1.2" ], @kamal.hosts
exception = assert_raises(ArgumentError) do
@kamal.specific_roles = [ "*miss" ]
end
assert_match /roles match for \*miss/, exception.message
end
test "filtering roles" do
@@ -57,10 +50,8 @@ class CommanderTest < ActiveSupport::TestCase
@kamal.specific_roles = [ "*" ]
assert_equal [ "web", "workers" ], @kamal.roles.map(&:name)
exception = assert_raises(ArgumentError) do
@kamal.specific_roles = [ "*miss" ]
end
assert_match /roles match for \*miss/, exception.message
assert_equal [], @kamal.roles.map(&:name)
end
test "filtering roles by filtering hosts" do
@@ -83,14 +74,14 @@ class CommanderTest < ActiveSupport::TestCase
end
test "primary_role" do
assert_equal "web", @kamal.primary_role.name
assert_equal "web", @kamal.primary_role
@kamal.specific_roles = "workers"
assert_equal "workers", @kamal.primary_role.name
assert_equal "workers", @kamal.primary_role
end
test "roles_on" do
assert_equal [ "web" ], @kamal.roles_on("1.1.1.1").map(&:name)
assert_equal [ "workers" ], @kamal.roles_on("1.1.1.3").map(&:name)
assert_equal [ "web" ], @kamal.roles_on("1.1.1.1")
assert_equal [ "workers" ], @kamal.roles_on("1.1.1.3")
end
test "default group strategy" do
@@ -109,22 +100,6 @@ class CommanderTest < ActiveSupport::TestCase
assert_equal({ in: :groups, limit: 1, wait: 2 }, @kamal.boot_strategy)
end
test "percentage-based group strategy limit is at least 1" do
configure_with(:deploy_with_low_percentage_boot_strategy)
assert_equal({ in: :groups, limit: 1, wait: 2 }, @kamal.boot_strategy)
end
test "try to match the primary role from a list of specific roles" do
configure_with(:deploy_primary_web_role_override)
@kamal.specific_roles = [ "web_*" ]
assert_equal [ "web_tokyo", "web_chicago" ], @kamal.roles.map(&:name)
assert_equal "web_tokyo", @kamal.primary_role.name
assert_equal "1.1.1.3", @kamal.primary_host
assert_equal [ "1.1.1.3", "1.1.1.4", "1.1.1.1", "1.1.1.2" ], @kamal.hosts
end
private
def configure_with(variant)
@kamal = Kamal::Commander.new.tap do |kamal|

View File

@@ -34,7 +34,6 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
]
},
"busybox" => {
"service" => "custom-busybox",
"image" => "busybox:latest",
"host" => "1.1.1.7"
}
@@ -50,15 +49,15 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
test "run" do
assert_equal \
"docker run --name app-mysql --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 3306:3306 --env-file .kamal/env/accessories/app-mysql.env --env MYSQL_ROOT_HOST=\"%\" --label service=\"app-mysql\" private.registry/mysql:8.0",
"docker run --name app-mysql --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 3306:3306 --env-file .kamal/env/accessories/app-mysql.env --label service=\"app-mysql\" private.registry/mysql:8.0",
new_command(:mysql).run.join(" ")
assert_equal \
"docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --env SOMETHING=\"else\" --volume /var/lib/redis:/data --label service=\"app-redis\" --label cache=\"true\" redis:latest",
"docker run --name app-redis --detach --restart unless-stopped --log-opt max-size=\"10m\" --publish 6379:6379 --env-file .kamal/env/accessories/app-redis.env --volume /var/lib/redis:/data --label service=\"app-redis\" --label cache=\"true\" redis:latest",
new_command(:redis).run.join(" ")
assert_equal \
"docker run --name custom-busybox --detach --restart unless-stopped --log-opt max-size=\"10m\" --env-file .kamal/env/accessories/custom-busybox.env --label service=\"custom-busybox\" busybox:latest",
"docker run --name app-busybox --detach --restart unless-stopped --log-opt max-size=\"10m\" --env-file .kamal/env/accessories/app-busybox.env --label service=\"app-busybox\" busybox:latest",
new_command(:busybox).run.join(" ")
end
@@ -66,7 +65,7 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
@config[:logging] = { "driver" => "local", "options" => { "max-size" => "100m", "max-file" => "3" } }
assert_equal \
"docker run --name custom-busybox --detach --restart unless-stopped --log-driver \"local\" --log-opt max-size=\"100m\" --log-opt max-file=\"3\" --env-file .kamal/env/accessories/custom-busybox.env --label service=\"custom-busybox\" busybox:latest",
"docker run --name app-busybox --detach --restart unless-stopped --log-driver \"local\" --log-opt max-size=\"100m\" --log-opt max-file=\"3\" --env-file .kamal/env/accessories/app-busybox.env --label service=\"app-busybox\" busybox:latest",
new_command(:busybox).run.join(" ")
end
@@ -91,7 +90,7 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
test "execute in new container" do
assert_equal \
"docker run --rm --env-file .kamal/env/accessories/app-mysql.env --env MYSQL_ROOT_HOST=\"%\" private.registry/mysql:8.0 mysql -u root",
"docker run --rm --env-file .kamal/env/accessories/app-mysql.env private.registry/mysql:8.0 mysql -u root",
new_command(:mysql).execute_in_new_container("mysql", "-u", "root").join(" ")
end
@@ -103,14 +102,14 @@ class CommandsAccessoryTest < ActiveSupport::TestCase
test "execute in new container over ssh" do
new_command(:mysql).stub(:run_over_ssh, ->(cmd) { cmd.join(" ") }) do
assert_match %r{docker run -it --rm --env-file .kamal/env/accessories/app-mysql.env --env MYSQL_ROOT_HOST=\"%\" private.registry/mysql:8.0 mysql -u root},
assert_match %r|docker run -it --rm --env-file .kamal/env/accessories/app-mysql.env private.registry/mysql:8.0 mysql -u root|,
new_command(:mysql).execute_in_new_container_over_ssh("mysql", "-u", "root")
end
end
test "execute in existing container over ssh" do
new_command(:mysql).stub(:run_over_ssh, ->(cmd) { cmd.join(" ") }) do
assert_match %r{docker exec -it app-mysql mysql -u root},
assert_match %r|docker exec -it app-mysql mysql -u root|,
new_command(:mysql).execute_in_existing_container_over_ssh("mysql", "-u", "root")
end
end

View File

@@ -14,13 +14,13 @@ class CommandsAppTest < ActiveSupport::TestCase
test "run" do
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
test "run with hostname" do
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 --hostname myhost -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 --hostname myhost -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run(hostname: "myhost").join(" ")
end
@@ -28,7 +28,7 @@ class CommandsAppTest < ActiveSupport::TestCase
@config[:volumes] = ["/local/path:/container/path" ]
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --volume /local/path:/container/path --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --volume /local/path:/container/path --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
@@ -36,7 +36,7 @@ class CommandsAppTest < ActiveSupport::TestCase
@config[:healthcheck] = { "path" => "/healthz" }
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/healthz || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/healthz || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
@@ -44,7 +44,7 @@ class CommandsAppTest < ActiveSupport::TestCase
@config[:healthcheck] = { "cmd" => "/bin/up" }
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(/bin/up) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(/bin/up) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
@@ -52,14 +52,14 @@ class CommandsAppTest < ActiveSupport::TestCase
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ], "healthcheck" => { "cmd" => "/bin/healthy" } } }
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(/bin/healthy) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(/bin/healthy) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
test "run with custom options" do
@config[:servers] = { "web" => [ "1.1.1.1" ], "jobs" => { "hosts" => [ "1.1.1.2" ], "cmd" => "bin/jobs", "options" => { "mount" => "somewhere", "cap-add" => true } } }
assert_equal \
"docker run --detach --restart unless-stopped --name app-jobs-999 -e KAMAL_CONTAINER_NAME=\"app-jobs-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-jobs.env --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"jobs\" --label destination --mount \"somewhere\" --cap-add dhh/app:999 bin/jobs",
"docker run --detach --restart unless-stopped --name app-jobs-999 -e KAMAL_CONTAINER_NAME=\"app-jobs-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-jobs.env --log-opt max-size=\"10m\" --label service=\"app\" --label role=\"jobs\" --mount \"somewhere\" --cap-add dhh/app:999 bin/jobs",
new_command(role: "jobs").run.join(" ")
end
@@ -67,16 +67,7 @@ class CommandsAppTest < ActiveSupport::TestCase
@config[:logging] = { "driver" => "local", "options" => { "max-size" => "100m", "max-file" => "3" } }
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-driver \"local\" --log-opt max-size=\"100m\" --log-opt max-file=\"3\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
test "run with role logging config" do
@config[:logging] = { "driver" => "local", "options" => { "max-size" => "10m", "max-file" => "3" } }
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ], "logging" => { "driver" => "local", "options" => { "max-size" => "100m" } } } }
assert_equal \
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-driver \"local\" --log-opt max-size=\"100m\" --log-opt max-file=\"3\" --label service=\"app\" --label role=\"web\" --label destination --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
"docker run --detach --restart unless-stopped --name app-web-999 -e KAMAL_CONTAINER_NAME=\"app-web-999\" -e KAMAL_VERSION=\"999\" --env-file .kamal/env/roles/app-web.env --health-cmd \"(curl -f http://localhost:3000/up || exit 1) && (stat /tmp/kamal-cord/cord > /dev/null || exit 1)\" --health-interval \"1s\" --volume $(pwd)/.kamal/cords/app-web-12345678901234567890123456789012:/tmp/kamal-cord --log-driver \"local\" --log-opt max-size=\"100m\" --log-opt max-file=\"3\" --label service=\"app\" --label role=\"web\" --label traefik.http.services.app-web.loadbalancer.server.scheme=\"http\" --label traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.app-web.priority=\"2\" --label traefik.http.middlewares.app-web-retry.retry.attempts=\"5\" --label traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\" --label traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\" dhh/app:999",
new_command.run.join(" ")
end
@@ -95,14 +86,14 @@ class CommandsAppTest < ActiveSupport::TestCase
test "stop" do
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker stop",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker stop",
new_command.stop.join(" ")
end
test "stop with custom stop wait time" do
@config[:stop_wait_time] = 30
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker stop -t 30",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker stop -t 30",
new_command.stop.join(" ")
end
@@ -128,94 +119,74 @@ class CommandsAppTest < ActiveSupport::TestCase
test "logs" do
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs 2>&1",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs 2>&1",
new_command.logs.join(" ")
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --since 5m 2>&1",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --since 5m 2>&1",
new_command.logs(since: "5m").join(" ")
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --tail 100 2>&1",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --tail 100 2>&1",
new_command.logs(lines: "100").join(" ")
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --since 5m --tail 100 2>&1",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --since 5m --tail 100 2>&1",
new_command.logs(since: "5m", lines: "100").join(" ")
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs 2>&1 | grep 'my-id'",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs 2>&1 | grep 'my-id'",
new_command.logs(grep: "my-id").join(" ")
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --since 5m 2>&1 | grep 'my-id'",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --since 5m 2>&1 | grep 'my-id'",
new_command.logs(since: "5m", grep: "my-id").join(" ")
end
test "follow logs" do
assert_equal \
"ssh -t root@app-1 -p 22 'sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --follow 2>&1'",
assert_match \
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --timestamps --tail 10 --follow 2>&1",
new_command.follow_logs(host: "app-1")
assert_equal \
"ssh -t root@app-1 -p 22 'sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --follow 2>&1 | grep \"Completed\"'",
assert_match \
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest | xargs docker logs --timestamps --tail 10 --follow 2>&1 | grep \"Completed\"",
new_command.follow_logs(host: "app-1", grep: "Completed")
assert_equal \
"ssh -t root@app-1 -p 22 'sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --tail 123 --follow 2>&1'",
new_command.follow_logs(host: "app-1", lines: 123)
assert_equal \
"ssh -t root@app-1 -p 22 'sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | xargs docker logs --timestamps --tail 123 --follow 2>&1 | grep \"Completed\"'",
new_command.follow_logs(host: "app-1", lines: 123, grep: "Completed")
end
test "execute in new container" do
assert_equal \
"docker run --rm --env-file .kamal/env/roles/app-web.env dhh/app:999 bin/rails db:setup",
new_command.execute_in_new_container("bin/rails", "db:setup", env: {}).join(" ")
end
test "execute in new container with env" do
assert_equal \
"docker run --rm --env-file .kamal/env/roles/app-web.env --env foo=\"bar\" dhh/app:999 bin/rails db:setup",
new_command.execute_in_new_container("bin/rails", "db:setup", env: { "foo" => "bar" }).join(" ")
new_command.execute_in_new_container("bin/rails", "db:setup").join(" ")
end
test "execute in new container with custom options" do
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ], "options" => { "mount" => "somewhere", "cap-add" => true } } }
assert_equal \
"docker run --rm --env-file .kamal/env/roles/app-web.env --mount \"somewhere\" --cap-add dhh/app:999 bin/rails db:setup",
new_command.execute_in_new_container("bin/rails", "db:setup", env: {}).join(" ")
new_command.execute_in_new_container("bin/rails", "db:setup").join(" ")
end
test "execute in existing container" do
assert_equal \
"docker exec app-web-999 bin/rails db:setup",
new_command.execute_in_existing_container("bin/rails", "db:setup", env: {}).join(" ")
end
test "execute in existing container with env" do
assert_equal \
"docker exec --env foo=\"bar\" app-web-999 bin/rails db:setup",
new_command.execute_in_existing_container("bin/rails", "db:setup", env: { "foo" => "bar" }).join(" ")
new_command.execute_in_existing_container("bin/rails", "db:setup").join(" ")
end
test "execute in new container over ssh" do
assert_match %r{docker run -it --rm --env-file .kamal/env/roles/app-web.env dhh/app:999 bin/rails c},
new_command.execute_in_new_container_over_ssh("bin/rails", "c", host: "app-1", env: {})
assert_match %r|docker run -it --rm --env-file .kamal/env/roles/app-web.env dhh/app:999 bin/rails c|,
new_command.execute_in_new_container_over_ssh("bin/rails", "c", host: "app-1")
end
test "execute in new container with custom options over ssh" do
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ], "options" => { "mount" => "somewhere", "cap-add" => true } } }
assert_match %r{docker run -it --rm --env-file .kamal/env/roles/app-web.env --mount \"somewhere\" --cap-add dhh/app:999 bin/rails c},
new_command.execute_in_new_container_over_ssh("bin/rails", "c", host: "app-1", env: {})
assert_match %r|docker run -it --rm --env-file .kamal/env/roles/app-web.env --mount \"somewhere\" --cap-add dhh/app:999 bin/rails c|,
new_command.execute_in_new_container_over_ssh("bin/rails", "c", host: "app-1")
end
test "execute in existing container over ssh" do
assert_match %r{docker exec -it app-web-999 bin/rails c},
new_command.execute_in_existing_container_over_ssh("bin/rails", "c", host: "app-1", env: {})
assert_match %r|docker exec -it app-web-999 bin/rails c|,
new_command.execute_in_existing_container_over_ssh("bin/rails", "c", host: "app-1")
end
test "run over ssh" do
@@ -254,14 +225,14 @@ class CommandsAppTest < ActiveSupport::TestCase
test "current_running_container_id" do
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1",
"docker ps --quiet --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest",
new_command.current_running_container_id.join(" ")
end
test "current_running_container_id with destination" do
@destination = "staging"
assert_equal \
"sh -c 'docker ps --latest --quiet --filter label=service=app --filter label=destination=staging --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest-staging --format '\\''{{.ID}}'\\'') ; docker ps --latest --quiet --filter label=service=app --filter label=destination=staging --filter label=role=web --filter status=running --filter status=restarting' | head -1",
"docker ps --quiet --filter label=service=app --filter label=destination=staging --filter label=role=web --filter status=running --filter status=restarting --latest",
new_command.current_running_container_id.join(" ")
end
@@ -273,7 +244,7 @@ class CommandsAppTest < ActiveSupport::TestCase
test "current_running_version" do
assert_equal \
"sh -c 'docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --filter ancestor=$(docker image ls --filter reference=dhh/app:latest --format '\\''{{.ID}}'\\'') ; docker ps --latest --format '\\''{{.Names}}'\\'' --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting' | head -1 | while read line; do echo ${line#app-web-}; done",
"docker ps --filter label=service=app --filter label=role=web --filter status=running --filter status=restarting --latest --format \"{{.Names}}\" | while read line; do echo ${line#app-web-}; done",
new_command.current_running_version.join(" ")
end
@@ -351,17 +322,10 @@ class CommandsAppTest < ActiveSupport::TestCase
new_command.remove_images.join(" ")
end
test "tag_latest_image" do
test "tag_current_image_as_latest" do
assert_equal \
"docker tag dhh/app:999 dhh/app:latest",
new_command.tag_latest_image.join(" ")
end
test "tag_latest_image with destination" do
@destination = "staging"
assert_equal \
"docker tag dhh/app:999 dhh/app:latest-staging",
new_command.tag_latest_image.join(" ")
new_command.tag_current_image_as_latest.join(" ")
end
test "make_env_directory" do
@@ -390,7 +354,7 @@ class CommandsAppTest < ActiveSupport::TestCase
assert_equal [
:mkdir, "-p", ".kamal/assets/extracted/app-web-999", "&&",
:docker, :stop, "-t 1", "app-web-assets", "2> /dev/null", "|| true", "&&",
:docker, :run, "--name", "app-web-assets", "--detach", "--rm", "dhh/app:999", "sleep 1000000", "&&",
:docker, :run, "--name", "app-web-assets", "--detach", "--rm", "dhh/app:latest", "sleep 1000000", "&&",
:docker, :cp, "-L", "app-web-assets:/public/assets/.", ".kamal/assets/extracted/app-web-999", "&&",
:docker, :stop, "-t 1", "app-web-assets"
], new_command(asset_path: "/public/assets").extract_assets
@@ -406,7 +370,7 @@ class CommandsAppTest < ActiveSupport::TestCase
:mkdir, "-p", ".kamal/assets/volumes/app-web-999", ";",
:cp, "-rnT", ".kamal/assets/extracted/app-web-999", ".kamal/assets/volumes/app-web-999", ";",
:cp, "-rnT", ".kamal/assets/extracted/app-web-999", ".kamal/assets/volumes/app-web-998", "|| true", ";",
:cp, "-rnT", ".kamal/assets/extracted/app-web-998", ".kamal/assets/volumes/app-web-999", "|| true"
:cp, "-rnT", ".kamal/assets/extracted/app-web-998", ".kamal/assets/volumes/app-web-999", "|| true",
], new_command(asset_path: "/public/assets").sync_asset_volumes(old_version: 998)
end
@@ -419,7 +383,6 @@ class CommandsAppTest < ActiveSupport::TestCase
private
def new_command(role: "web", **additional_config)
config = Kamal::Configuration.new(@config.merge(additional_config), destination: @destination, version: "999")
Kamal::Commands::App.new(config, role: config.role(role))
Kamal::Commands::App.new(Kamal::Configuration.new(@config.merge(additional_config), destination: @destination, version: "999"), role: role)
end
end

View File

@@ -9,7 +9,7 @@ class CommandsBuilderTest < ActiveSupport::TestCase
builder = new_builder_command(builder: { "cache" => { "type" => "gha" }})
assert_equal "multiarch", builder.name
assert_equal \
"git archive --format=tar HEAD | docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile -",
"docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile .",
builder.push.join(" ")
end
@@ -17,7 +17,7 @@ class CommandsBuilderTest < ActiveSupport::TestCase
builder = new_builder_command(builder: { "multiarch" => false })
assert_equal "native", builder.name
assert_equal \
"git archive --format=tar HEAD | docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile - && docker push dhh/app:123 && docker push dhh/app:latest",
"docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile . && docker push dhh/app:123 && docker push dhh/app:latest",
builder.push.join(" ")
end
@@ -25,7 +25,7 @@ class CommandsBuilderTest < ActiveSupport::TestCase
builder = new_builder_command(builder: { "multiarch" => false, "cache" => { "type" => "gha" }})
assert_equal "native/cached", builder.name
assert_equal \
"git archive --format=tar HEAD | docker buildx build --push -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile -",
"docker buildx build --push -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile .",
builder.push.join(" ")
end
@@ -33,15 +33,7 @@ class CommandsBuilderTest < ActiveSupport::TestCase
builder = new_builder_command(builder: { "local" => { }, "remote" => { }, "cache" => { "type" => "gha" } })
assert_equal "multiarch/remote", builder.name
assert_equal \
"git archive --format=tar HEAD | docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch-remote -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile -",
builder.push.join(" ")
end
test "target multiarch local when arch is set" do
builder = new_builder_command(builder: { "local" => { "arch" => "amd64" } })
assert_equal "multiarch", builder.name
assert_equal \
"git archive --format=tar HEAD | docker buildx build --push --platform linux/amd64 --builder kamal-app-multiarch -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile -",
"docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch-remote -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile .",
builder.push.join(" ")
end
@@ -49,7 +41,7 @@ class CommandsBuilderTest < ActiveSupport::TestCase
builder = new_builder_command(builder: { "remote" => { "arch" => "amd64" }, "cache" => { "type" => "gha" } })
assert_equal "native/remote", builder.name
assert_equal \
"git archive --format=tar HEAD | docker buildx build --push --platform linux/amd64 --builder kamal-app-native-remote -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile -",
"docker buildx build --push --platform linux/amd64 --builder kamal-app-native-remote -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile .",
builder.push.join(" ")
end
@@ -93,62 +85,26 @@ class CommandsBuilderTest < ActiveSupport::TestCase
test "native push with build args" do
builder = new_builder_command(builder: { "multiarch" => false, "args" => { "a" => 1, "b" => 2 } })
assert_equal \
"git archive --format=tar HEAD | docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --build-arg a=\"1\" --build-arg b=\"2\" --file Dockerfile - && docker push dhh/app:123 && docker push dhh/app:latest",
"docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --build-arg a=\"1\" --build-arg b=\"2\" --file Dockerfile . && docker push dhh/app:123 && docker push dhh/app:latest",
builder.push.join(" ")
end
test "multiarch push with build args" do
builder = new_builder_command(builder: { "args" => { "a" => 1, "b" => 2 } })
assert_equal \
"git archive --format=tar HEAD | docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --build-arg a=\"1\" --build-arg b=\"2\" --file Dockerfile -",
"docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --build-arg a=\"1\" --build-arg b=\"2\" --file Dockerfile .",
builder.push.join(" ")
end
test "native push with build secrets" do
builder = new_builder_command(builder: { "multiarch" => false, "secrets" => [ "a", "b" ] })
assert_equal \
"git archive --format=tar HEAD | docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --secret id=\"a\" --secret id=\"b\" --file Dockerfile - && docker push dhh/app:123 && docker push dhh/app:latest",
"docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --secret id=\"a\" --secret id=\"b\" --file Dockerfile . && docker push dhh/app:123 && docker push dhh/app:latest",
builder.push.join(" ")
end
test "build with ssh agent socket" do
builder = new_builder_command(builder: { "ssh" => "default=$SSH_AUTH_SOCK" })
assert_equal \
"-t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile --ssh default=$SSH_AUTH_SOCK",
builder.target.build_options.join(" ")
end
test "validate image" do
assert_equal "docker inspect -f '{{ .Config.Labels.service }}' dhh/app:123 | grep -x app || (echo \"Image dhh/app:123 is missing the 'service' label\" && exit 1)", new_builder_command.validate_image.join(" ")
end
test "multiarch context build" do
builder = new_builder_command(builder: { "context" => "./foo" })
assert_equal \
"docker buildx build --push --platform linux/amd64,linux/arm64 --builder kamal-app-multiarch -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile ./foo",
builder.push.join(" ")
end
test "native context build" do
builder = new_builder_command(builder: { "multiarch" => false, "context" => "./foo" })
assert_equal \
"docker build -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile ./foo && docker push dhh/app:123 && docker push dhh/app:latest",
builder.push.join(" ")
end
test "cached context build" do
builder = new_builder_command(builder: { "multiarch" => false, "context" => "./foo", "cache" => { "type" => "gha" } })
assert_equal \
"docker buildx build --push -t dhh/app:123 -t dhh/app:latest --cache-to type=gha --cache-from type=gha --label service=\"app\" --file Dockerfile ./foo",
builder.push.join(" ")
end
test "remote context build" do
builder = new_builder_command(builder: { "remote" => { "arch" => "amd64" }, "context" => "./foo" })
assert_equal \
"docker buildx build --push --platform linux/amd64 --builder kamal-app-native-remote -t dhh/app:123 -t dhh/app:latest --label service=\"app\" --file Dockerfile ./foo",
builder.push.join(" ")
assert_equal "docker inspect -f '{{ .Config.Labels.service }}' dhh/app:123 | grep -x app || (echo \"Image dhh/app:123 is missing the `service` label\" && exit 1)", new_builder_command.validate_image.join(" ")
end
private

View File

@@ -9,7 +9,7 @@ class CommandsDockerTest < ActiveSupport::TestCase
end
test "install" do
assert_equal "sh -c 'curl -fsSL https://get.docker.com || wget -O - https://get.docker.com || echo \"exit 1\"' | sh", @docker.install.join(" ")
assert_equal "curl -fsSL https://get.docker.com | sh", @docker.install.join(" ")
end
test "installed?" do

View File

@@ -46,6 +46,14 @@ class CommandsHealthcheckTest < ActiveSupport::TestCase
new_command.run.join(" ")
end
test "run with custom per-role healthcheck options" do
@config[:servers] = { "web" => { "hosts" => [ "1.1.1.1" ],
"healthcheck" => { "log_lines" => 150 } } }
assert_equal \
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker logs --tail 150 2>&1",
new_command.logs.join(" ")
end
test "status" do
assert_equal \
"docker container ls --all --filter name=^healthcheck-app-123$ --quiet | xargs docker inspect --format '{{if .State.Health}}{{.State.Health.Status}}{{else}}{{.State.Status}}{{end}}'",

View File

@@ -10,24 +10,24 @@ class CommandsLockTest < ActiveSupport::TestCase
test "status" do
assert_equal \
"stat .kamal/locks/app-production > /dev/null && cat .kamal/locks/app-production/details | base64 -d",
"stat .kamal/lock-app > /dev/null && cat .kamal/lock-app/details | base64 -d",
new_command.status.join(" ")
end
test "acquire" do
assert_match \
%r{mkdir \.kamal/locks/app-production && echo ".*" > \.kamal/locks/app-production/details}m,
%r{mkdir \.kamal/lock-app && echo ".*" > \.kamal/lock-app/details}m,
new_command.acquire("Hello", "123").join(" ")
end
test "release" do
assert_match \
"rm .kamal/locks/app-production/details && rm -r .kamal/locks/app-production",
"rm .kamal/lock-app/details && rm -r .kamal/lock-app",
new_command.release.join(" ")
end
private
def new_command
Kamal::Commands::Lock.new(Kamal::Configuration.new(@config, version: "123", destination: "production"))
Kamal::Commands::Lock.new(Kamal::Configuration.new(@config, version: "123"))
end
end

View File

@@ -23,11 +23,7 @@ class CommandsPruneTest < ActiveSupport::TestCase
test "app containers" do
assert_equal \
"docker ps -q -a --filter label=service=app --filter status=created --filter status=exited --filter status=dead | tail -n +6 | while read container_id; do docker rm $container_id; done",
new_command.app_containers(retain: 5).join(" ")
assert_equal \
"docker ps -q -a --filter label=service=app --filter status=created --filter status=exited --filter status=dead | tail -n +4 | while read container_id; do docker rm $container_id; done",
new_command.app_containers(retain: 3).join(" ")
new_command.app_containers.join(" ")
end
test "healthcheck containers" do

View File

@@ -15,7 +15,7 @@ class CommandsRegistryTest < ActiveSupport::TestCase
test "registry login" do
assert_equal \
"docker login hub.docker.com -u \"dhh\" -p \"secret\"",
"docker login hub.docker.com -u dhh -p secret",
@registry.login.join(" ")
end
@@ -24,18 +24,7 @@ class CommandsRegistryTest < ActiveSupport::TestCase
@config[:registry]["password"] = [ "KAMAL_REGISTRY_PASSWORD" ]
assert_equal \
"docker login hub.docker.com -u \"dhh\" -p \"more-secret\"",
@registry.login.join(" ")
ensure
ENV.delete("KAMAL_REGISTRY_PASSWORD")
end
test "registry login escape password" do
ENV["KAMAL_REGISTRY_PASSWORD"] = "more-secret'\""
@config[:registry]["password"] = [ "KAMAL_REGISTRY_PASSWORD" ]
assert_equal \
"docker login hub.docker.com -u \"dhh\" -p \"more-secret'\\\"\"",
"docker login hub.docker.com -u dhh -p more-secret",
@registry.login.join(" ")
ensure
ENV.delete("KAMAL_REGISTRY_PASSWORD")
@@ -46,7 +35,7 @@ class CommandsRegistryTest < ActiveSupport::TestCase
@config[:registry]["username"] = [ "KAMAL_REGISTRY_USERNAME" ]
assert_equal \
"docker login hub.docker.com -u \"also-secret\" -p \"secret\"",
"docker login hub.docker.com -u also-secret -p secret",
@registry.login.join(" ")
ensure
ENV.delete("KAMAL_REGISTRY_USERNAME")

View File

@@ -138,7 +138,7 @@ class CommandsTraefikTest < ActiveSupport::TestCase
test "traefik logs since 2h" do
assert_equal \
"docker logs traefik --since 2h --timestamps 2>&1",
new_command.logs(since: "2h").join(" ")
new_command.logs(since: '2h').join(" ")
end
test "traefik logs last 10 lines" do
@@ -150,7 +150,7 @@ class CommandsTraefikTest < ActiveSupport::TestCase
test "traefik logs with grep hello!" do
assert_equal \
"docker logs traefik --timestamps 2>&1 | grep 'hello!'",
new_command.logs(grep: "hello!").join(" ")
new_command.logs(grep: 'hello!').join(" ")
end
test "traefik remove container" do
@@ -174,13 +174,17 @@ class CommandsTraefikTest < ActiveSupport::TestCase
test "traefik follow logs with grep hello!" do
assert_equal \
"ssh -t root@1.1.1.1 -p 22 'docker logs traefik --timestamps --tail 10 --follow 2>&1 | grep \"hello!\"'",
new_command.follow_logs(host: @config[:servers].first, grep: "hello!")
new_command.follow_logs(host: @config[:servers].first, grep: 'hello!')
end
test "secrets io" do
test "env_file" do
@config[:traefik]["env"] = { "secret" => %w[EXAMPLE_API_KEY] }
assert_equal "EXAMPLE_API_KEY=456\n", new_command.env.secrets_io.string
assert_equal "EXAMPLE_API_KEY=456\n", new_command.env_file.to_s
end
test "host_env_file_path" do
assert_equal ".kamal/env/traefik/traefik.env", new_command.host_env_file_path
end
test "make_env_directory" do

View File

@@ -20,7 +20,7 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
},
"secret" => [
"MYSQL_ROOT_PASSWORD"
]
],
},
"files" => [
"config/mysql/my.cnf:/etc/mysql/my.cnf",
@@ -49,7 +49,6 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
}
},
"monitoring" => {
"service" => "custom-monitoring",
"image" => "monitoring:latest",
"roles" => [ "web" ],
"port" => "4321:4321",
@@ -73,7 +72,6 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
test "service name" do
assert_equal "app-mysql", @config.accessory(:mysql).service_name
assert_equal "app-redis", @config.accessory(:redis).service_name
assert_equal "custom-monitoring", @config.accessory(:monitoring).service_name
end
test "port" do
@@ -107,35 +105,35 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
assert_equal "Specify one of `host`, `hosts` or `roles` for accessory `mysql`", exception.message
end
test "all hosts" do
assert_equal [ "1.1.1.1", "1.1.1.2", "1.1.1.3", "1.1.1.4", "1.1.1.5", "1.1.1.6", "1.1.1.7" ], @config.all_hosts
end
test "label args" do
assert_equal ["--label", "service=\"app-mysql\""], @config.accessory(:mysql).label_args
assert_equal ["--label", "service=\"app-redis\"", "--label", "cache=\"true\""], @config.accessory(:redis).label_args
end
test "env args" do
assert_equal [ "--env-file", ".kamal/env/accessories/app-mysql.env", "--env", "MYSQL_ROOT_HOST=\"%\"" ], @config.accessory(:mysql).env_args
assert_equal [ "--env-file", ".kamal/env/accessories/app-redis.env", "--env", "SOMETHING=\"else\"" ], @config.accessory(:redis).env_args
assert_equal ["--env-file", ".kamal/env/accessories/app-mysql.env"], @config.accessory(:mysql).env_args
assert_equal ["--env-file", ".kamal/env/accessories/app-redis.env"], @config.accessory(:redis).env_args
end
test "env with secrets" do
test "env file with secret" do
ENV["MYSQL_ROOT_PASSWORD"] = "secret123"
expected_secrets_file = <<~ENV
expected = <<~ENV
MYSQL_ROOT_PASSWORD=secret123
MYSQL_ROOT_HOST=%
ENV
assert_equal expected_secrets_file, @config.accessory(:mysql).env.secrets_io.string
assert_equal [ "--env-file", ".kamal/env/accessories/app-mysql.env", "--env", "MYSQL_ROOT_HOST=\"%\"" ], @config.accessory(:mysql).env_args
assert_equal expected, @config.accessory(:mysql).env_file.to_s
ensure
ENV["MYSQL_ROOT_PASSWORD"] = nil
end
test "env secrets path" do
assert_equal ".kamal/env/accessories/app-mysql.env", @config.accessory(:mysql).env.secrets_file
test "host_env_directory" do
assert_equal ".kamal/env/accessories", @config.accessory(:mysql).host_env_directory
end
test "host_env_file_path" do
assert_equal ".kamal/env/accessories/app-mysql.env", @config.accessory(:mysql).host_env_file_path
end
test "volume args" do
@@ -151,16 +149,10 @@ class ConfigurationAccessoryTest < ActiveSupport::TestCase
assert_match "%", @config.accessory(:mysql).files.keys[2].read
end
test "directory with a relative path" do
@deploy[:accessories]["mysql"]["directories"] = [ "data:/var/lib/mysql" ]
test "directories" do
assert_equal({"$PWD/app-mysql/data"=>"/var/lib/mysql"}, @config.accessory(:mysql).directories)
end
test "directory with an absolute path" do
@deploy[:accessories]["mysql"]["directories"] = [ "/var/data/mysql:/var/lib/mysql" ]
assert_equal({ "/var/data/mysql"=>"/var/lib/mysql" }, @config.accessory(:mysql).directories)
end
test "options" do
assert_equal ["--cpus", "\"4\"", "--memory", "\"2GB\""], @config.accessory(:redis).option_args
end

View File

@@ -140,7 +140,7 @@ class ConfigurationBuilderTest < ActiveSupport::TestCase
end
test "context" do
assert_equal "-", @config.builder.context
assert_equal ".", @config.builder.context
end
test "setting context" do
@@ -148,14 +148,4 @@ class ConfigurationBuilderTest < ActiveSupport::TestCase
assert_equal "..", @config_with_builder_option.builder.context
end
test "ssh" do
assert_nil @config.builder.ssh
end
test "setting ssh params" do
@deploy_with_builder_option[:builder] = { "ssh" => "default=$SSH_AUTH_SOCK" }
assert_equal "default=$SSH_AUTH_SOCK", @config_with_builder_option.builder.ssh
end
end

View File

@@ -1,74 +0,0 @@
require "test_helper"
class ConfigurationEnvTest < ActiveSupport::TestCase
require "test_helper"
test "simple" do
assert_config \
config: { "foo" => "bar", "baz" => "haz" },
clear: { "foo" => "bar", "baz" => "haz" },
secrets: {}
end
test "clear" do
assert_config \
config: { "clear" => { "foo" => "bar", "baz" => "haz" } },
clear: { "foo" => "bar", "baz" => "haz" },
secrets: {}
end
test "secret" do
ENV["PASSWORD"] = "hello"
env = Kamal::Configuration::Env.from_config config: { "secret" => [ "PASSWORD" ] }
assert_config \
config: { "secret" => [ "PASSWORD" ] },
clear: {},
secrets: { "PASSWORD" => "hello" }
ensure
ENV.delete "PASSWORD"
end
test "missing secret" do
env = {
"secret" => [ "PASSWORD" ]
}
assert_raises(KeyError) { Kamal::Configuration::Env.from_config(config: { "secret" => [ "PASSWORD" ] }).secrets }
end
test "secret and clear" do
ENV["PASSWORD"] = "hello"
config = {
"secret" => [ "PASSWORD" ],
"clear" => {
"foo" => "bar",
"baz" => "haz"
}
}
assert_config \
config: config,
clear: { "foo" => "bar", "baz" => "haz" },
secrets: { "PASSWORD" => "hello" }
ensure
ENV.delete "PASSWORD"
end
test "stringIO conversion" do
env = {
"foo" => "bar",
"baz" => "haz"
}
assert_equal "foo=bar\nbaz=haz\n", \
StringIO.new(Kamal::EnvFile.new(env)).read
end
private
def assert_config(config:, clear:, secrets:)
env = Kamal::Configuration::Env.from_config config: config
assert_equal clear, env.clear
assert_equal secrets, env.secrets
end
end

View File

@@ -38,11 +38,11 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
end
test "label args" do
assert_equal [ "--label", "service=\"app\"", "--label", "role=\"workers\"", "--label", "destination" ], @config_with_roles.role(:workers).label_args
assert_equal [ "--label", "service=\"app\"", "--label", "role=\"workers\"" ], @config_with_roles.role(:workers).label_args
end
test "special label args for web" do
assert_equal [ "--label", "service=\"app\"", "--label", "role=\"web\"", "--label", "destination", "--label", "traefik.http.services.app-web.loadbalancer.server.scheme=\"http\"", "--label", "traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\"", "--label", "traefik.http.routers.app-web.priority=\"2\"", "--label", "traefik.http.middlewares.app-web-retry.retry.attempts=\"5\"", "--label", "traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\"", "--label", "traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\"" ], @config.role(:web).label_args
assert_equal [ "--label", "service=\"app\"", "--label", "role=\"web\"", "--label", "traefik.http.services.app-web.loadbalancer.server.scheme=\"http\"", "--label", "traefik.http.routers.app-web.rule=\"PathPrefix(\\`/\\`)\"", "--label", "traefik.http.routers.app-web.priority=\"2\"", "--label", "traefik.http.middlewares.app-web-retry.retry.attempts=\"5\"", "--label", "traefik.http.middlewares.app-web-retry.retry.initialinterval=\"500ms\"", "--label", "traefik.http.routers.app-web.middlewares=\"app-web-retry@docker\"" ], @config.role(:web).label_args
end
test "custom labels" do
@@ -53,8 +53,7 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
test "custom labels via role specialization" do
@deploy_with_roles[:labels] = { "my.custom.label" => "50" }
@deploy_with_roles[:servers]["workers"]["labels"] = { "my.custom.label" => "70" }
config_with_roles = Kamal::Configuration.new(@deploy_with_roles)
assert_equal "70", config_with_roles.role(:workers).labels["my.custom.label"]
assert_equal "70", @config_with_roles.role(:workers).labels["my.custom.label"]
end
test "overwriting default traefik label" do
@@ -67,14 +66,18 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
c[:servers]["beta"] = { "traefik" => "true", "hosts" => [ "1.1.1.5" ] }
})
assert_equal [ "--label", "service=\"app\"", "--label", "role=\"beta\"", "--label", "destination", "--label", "traefik.http.services.app-beta.loadbalancer.server.scheme=\"http\"", "--label", "traefik.http.routers.app-beta.rule=\"PathPrefix(\\`/\\`)\"", "--label", "traefik.http.routers.app-beta.priority=\"2\"", "--label", "traefik.http.middlewares.app-beta-retry.retry.attempts=\"5\"", "--label", "traefik.http.middlewares.app-beta-retry.retry.initialinterval=\"500ms\"", "--label", "traefik.http.routers.app-beta.middlewares=\"app-beta-retry@docker\"" ], config.role(:beta).label_args
assert_equal [ "--label", "service=\"app\"", "--label", "role=\"beta\"", "--label", "traefik.http.services.app-beta.loadbalancer.server.scheme=\"http\"", "--label", "traefik.http.routers.app-beta.rule=\"PathPrefix(\\`/\\`)\"", "--label", "traefik.http.routers.app-beta.priority=\"2\"", "--label", "traefik.http.middlewares.app-beta-retry.retry.attempts=\"5\"", "--label", "traefik.http.middlewares.app-beta-retry.retry.initialinterval=\"500ms\"", "--label", "traefik.http.routers.app-beta.middlewares=\"app-beta-retry@docker\"" ], config.role(:beta).label_args
end
test "env overwritten by role" do
assert_equal "redis://a/b", @config_with_roles.role(:workers).env.clear["REDIS_URL"]
assert_equal "redis://a/b", @config_with_roles.role(:workers).env["REDIS_URL"]
assert_equal "\n", @config_with_roles.role(:workers).env.secrets_io.string
assert_equal [ "--env-file", ".kamal/env/roles/app-workers.env", "--env", "REDIS_URL=\"redis://a/b\"", "--env", "WEB_CONCURRENCY=\"4\"" ], @config_with_roles.role(:workers).env_args
expected_env = <<~ENV
REDIS_URL=redis://a/b
WEB_CONCURRENCY=4
ENV
assert_equal expected_env, @config_with_roles.role(:workers).env_file.to_s
end
test "container name" do
@@ -87,7 +90,7 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
end
test "env args" do
assert_equal [ "--env-file", ".kamal/env/roles/app-workers.env", "--env", "REDIS_URL=\"redis://a/b\"", "--env", "WEB_CONCURRENCY=\"4\"" ], @config_with_roles.role(:workers).env_args
assert_equal ["--env-file", ".kamal/env/roles/app-workers.env"], @config_with_roles.role(:workers).env_args
end
test "env secret overwritten by role" do
@@ -110,18 +113,17 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
]
}
config_with_roles = Kamal::Configuration.new(@deploy_with_roles)
ENV["REDIS_PASSWORD"] = "secret456"
ENV["DB_PASSWORD"] = "secret&\"123"
expected_secrets_file = <<~ENV
expected = <<~ENV
REDIS_PASSWORD=secret456
DB_PASSWORD=secret&\"123
REDIS_URL=redis://a/b
WEB_CONCURRENCY=4
ENV
assert_equal expected_secrets_file, config_with_roles.role(:workers).env.secrets_io.string
assert_equal [ "--env-file", ".kamal/env/roles/app-workers.env", "--env", "REDIS_URL=\"redis://a/b\"", "--env", "WEB_CONCURRENCY=\"4\"" ], config_with_roles.role(:workers).env_args
assert_equal expected, @config_with_roles.role(:workers).env_file.to_s
ensure
ENV["REDIS_PASSWORD"] = nil
ENV["DB_PASSWORD"] = nil
@@ -138,16 +140,15 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
]
}
config_with_roles = Kamal::Configuration.new(@deploy_with_roles)
ENV["DB_PASSWORD"] = "secret123"
expected_secrets_file = <<~ENV
expected = <<~ENV
DB_PASSWORD=secret123
REDIS_URL=redis://a/b
WEB_CONCURRENCY=4
ENV
assert_equal expected_secrets_file, config_with_roles.role(:workers).env.secrets_io.string
assert_equal [ "--env-file", ".kamal/env/roles/app-workers.env", "--env", "REDIS_URL=\"redis://a/b\"", "--env", "WEB_CONCURRENCY=\"4\"" ], config_with_roles.role(:workers).env_args
assert_equal expected, @config_with_roles.role(:workers).env_file.to_s
ensure
ENV["DB_PASSWORD"] = nil
end
@@ -164,53 +165,28 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
ENV["REDIS_PASSWORD"] = "secret456"
expected_secrets_file = <<~ENV
expected = <<~ENV
REDIS_PASSWORD=secret456
REDIS_URL=redis://a/b
WEB_CONCURRENCY=4
ENV
assert_equal expected_secrets_file, @config_with_roles.role(:workers).env.secrets_io.string
assert_equal [ "--env-file", ".kamal/env/roles/app-workers.env", "--env", "REDIS_URL=\"redis://a/b\"", "--env", "WEB_CONCURRENCY=\"4\"" ], @config_with_roles.role(:workers).env_args
assert_equal expected, @config_with_roles.role(:workers).env_file.to_s
ensure
ENV["REDIS_PASSWORD"] = nil
end
test "env overwritten by role with secrets" do
@deploy_with_roles[:env] = {
"clear" => {
"REDIS_URL" => "redis://a/b"
},
"secret" => [
"REDIS_PASSWORD"
]
}
@deploy_with_roles[:servers]["workers"]["env"] = {
"clear" => {
"REDIS_URL" => "redis://c/d"
}
}
config_with_roles = Kamal::Configuration.new(@deploy_with_roles)
ENV["REDIS_PASSWORD"] = "secret456"
expected_secrets_file = <<~ENV
REDIS_PASSWORD=secret456
ENV
assert_equal expected_secrets_file, config_with_roles.role(:workers).env.secrets_io.string
assert_equal [ "--env-file", ".kamal/env/roles/app-workers.env", "--env", "REDIS_URL=\"redis://c/d\"" ], config_with_roles.role(:workers).env_args
ensure
ENV["REDIS_PASSWORD"] = nil
test "host_env_directory" do
assert_equal ".kamal/env/roles", @config_with_roles.role(:workers).host_env_directory
end
test "env secrets_file" do
assert_equal ".kamal/env/roles/app-workers.env", @config_with_roles.role(:workers).env.secrets_file
test "host_env_file_path" do
assert_equal ".kamal/env/roles/app-workers.env", @config_with_roles.role(:workers).host_env_file_path
end
test "uses cord" do
assert @config_with_roles.role(:web).uses_cord?
assert_not @config_with_roles.role(:workers).uses_cord?
assert !@config_with_roles.role(:workers).uses_cord?
end
test "cord host file" do
@@ -234,8 +210,8 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
assert_nil @config_with_roles.role(:workers).asset_volume_args
assert_nil @config_with_roles.role(:web).asset_path
assert_nil @config_with_roles.role(:workers).asset_path
assert_not @config_with_roles.role(:web).assets?
assert_not @config_with_roles.role(:workers).assets?
assert !@config_with_roles.role(:web).assets?
assert !@config_with_roles.role(:workers).assets?
config_with_assets = Kamal::Configuration.new(@deploy_with_roles.dup.tap { |c|
c[:asset_path] = "foo"
@@ -245,7 +221,7 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
assert_equal ["--volume", "$(pwd)/.kamal/assets/volumes/app-web-12345:foo"], config_with_assets.role(:web).asset_volume_args
assert_nil config_with_assets.role(:workers).asset_volume_args
assert config_with_assets.role(:web).assets?
assert_not config_with_assets.role(:workers).assets?
assert !config_with_assets.role(:workers).assets?
config_with_assets = Kamal::Configuration.new(@deploy_with_roles.dup.tap { |c|
c[:servers]["web"] = { "hosts" => [ "1.1.1.1", "1.1.1.2" ], "asset_path" => "bar" }
@@ -255,7 +231,7 @@ class ConfigurationRoleTest < ActiveSupport::TestCase
assert_equal ["--volume", "$(pwd)/.kamal/assets/volumes/app-web-12345:bar"], config_with_assets.role(:web).asset_volume_args
assert_nil config_with_assets.role(:workers).asset_volume_args
assert config_with_assets.role(:web).assets?
assert_not config_with_assets.role(:workers).assets?
assert !config_with_assets.role(:workers).assets?
ensure
ENV.delete("VERSION")

View File

@@ -42,17 +42,6 @@ class ConfigurationTest < ActiveSupport::TestCase
end
end
test "service name valid" do
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "hey-app1_primary" }).valid?
assert Kamal::Configuration.new(@deploy.tap { _1[:service] = "MyApp" }).valid?
end
test "service name invalid" do
assert_raise(ArgumentError) do
Kamal::Configuration.new @deploy.tap { _1[:service] = "app.com" }
end
end
test "roles" do
assert_equal %w[ web ], @config.roles.collect(&:name)
assert_equal %w[ web workers ], @config_with_roles.roles.collect(&:name)
@@ -104,17 +93,7 @@ class ConfigurationTest < ActiveSupport::TestCase
Kamal::Git.expects(:revision).returns("git-version")
Kamal::Git.expects(:uncommitted_changes).returns("M file\n")
assert_equal "git-version", @config.version
end
test "version from uncommitted context" do
ENV.delete("VERSION")
config = Kamal::Configuration.new(@deploy.tap { |c| c[:builder] = { "context" => "." } })
Kamal::Git.expects(:revision).returns("git-version")
Kamal::Git.expects(:uncommitted_changes).returns("M file\n")
assert_match /^git-version_uncommitted_[0-9a-f]{16}$/, config.version
assert_match /^git-version_uncommitted_[0-9a-f]{16}$/, @config.version
end
test "version from env" do
@@ -251,19 +230,19 @@ class ConfigurationTest < ActiveSupport::TestCase
test "to_h" do
expected_config = \
{ roles: [ "web" ],
hosts: [ "1.1.1.1", "1.1.1.2" ],
primary_host: "1.1.1.1",
version: "missing",
repository: "dhh/app",
absolute_image: "dhh/app:missing",
service_with_version: "app-missing",
ssh_options: { user: "root", port: 22, log_level: :fatal, keepalive: true, keepalive_interval: 30 },
sshkit: {},
volume_args: [ "--volume", "/local/path:/container/path" ],
builder: {},
logging: [ "--log-opt", "max-size=\"10m\"" ],
healthcheck: { "path"=>"/up", "port"=>3000, "max_attempts" => 7, "exposed_port" => 3999, "cord" => "/tmp/kamal-cord", "log_lines" => 50 } }
{ :roles=>["web"],
:hosts=>["1.1.1.1", "1.1.1.2"],
:primary_host=>"1.1.1.1",
:version=>"missing",
:repository=>"dhh/app",
:absolute_image=>"dhh/app:missing",
:service_with_version=>"app-missing",
:ssh_options=>{ :user=>"root", port: 22, log_level: :fatal, keepalive: true, keepalive_interval: 30 },
:sshkit=>{},
:volume_args=>["--volume", "/local/path:/container/path"],
:builder=>{},
:logging=>["--log-opt", "max-size=\"10m\""],
:healthcheck=>{ "path"=>"/up", "port"=>3000, "max_attempts" => 7, "exposed_port" => 3999, "cord" => "/tmp/kamal-cord", "log_lines" => 50 }}
assert_equal expected_config, @config.to_h
end
@@ -311,14 +290,14 @@ class ConfigurationTest < ActiveSupport::TestCase
end
test "primary role" do
assert_equal "web", @config.primary_role.name
assert_equal "web", @config.primary_role
config = Kamal::Configuration.new(@deploy_with_roles.deep_merge({
servers: { "alternate_web" => { "hosts" => [ "1.1.1.4", "1.1.1.5" ] } },
primary_role: "alternate_web" } ))
assert_equal "alternate_web", config.primary_role.name
assert_equal "alternate_web", config.primary_role
assert_equal "1.1.1.4", config.primary_host
assert config.role(:alternate_web).primary?
assert config.role(:alternate_web).running_traefik?
@@ -330,12 +309,4 @@ class ConfigurationTest < ActiveSupport::TestCase
end
assert_match /bar isn't defined/, error.message
end
test "retain_containers" do
assert_equal 5, @config.retain_containers
config = Kamal::Configuration.new(@deploy_with_roles.merge(retain_containers: 2))
assert_equal 2, config.retain_containers
assert_raises(ArgumentError) { Kamal::Configuration.new(@deploy_with_roles.merge(retain_containers: 0)) }
end
end

View File

@@ -1,7 +1,7 @@
require "test_helper"
class EnvFileTest < ActiveSupport::TestCase
test "to_s" do
test "env file simple" do
env = {
"foo" => "bar",
"baz" => "haz"
@@ -11,54 +11,80 @@ class EnvFileTest < ActiveSupport::TestCase
Kamal::EnvFile.new(env).to_s
end
test "to_str won't escape chinese characters" do
test "env file clear" do
env = {
"foo" => '你好 means hello, "欢迎" means welcome, that\'s simple! 😃 {smile}'
"clear" => {
"foo" => "bar",
"baz" => "haz"
}
}
assert_equal "foo=你好 means hello, \"欢迎\" means welcome, that's simple! 😃 {smile}\n",
assert_equal "foo=bar\nbaz=haz\n", \
Kamal::EnvFile.new(env).to_s
end
test "to_s won't escape japanese characters" do
env = {
"foo" => 'こんにちは means hello, "ようこそ" means welcome, that\'s simple! 😃 {smile}'
}
assert_equal "foo=こんにちは means hello, \"ようこそ\" means welcome, that's simple! 😃 {smile}\n", \
Kamal::EnvFile.new(env).to_s
end
test "to_s won't escape korean characters" do
env = {
"foo" => '안녕하세요 means hello, "어서 오십시오" means welcome, that\'s simple! 😃 {smile}'
}
assert_equal "foo=안녕하세요 means hello, \"어서 오십시오\" means welcome, that's simple! 😃 {smile}\n", \
Kamal::EnvFile.new(env).to_s
end
test "to_s empty" do
test "env file empty" do
assert_equal "\n", Kamal::EnvFile.new({}).to_s
end
test "to_s escaped newline" do
test "env file secret" do
ENV["PASSWORD"] = "hello"
env = {
"foo" => "hello\\nthere"
"secret" => [ "PASSWORD" ]
}
assert_equal "foo=hello\\\\nthere\n", \
assert_equal "PASSWORD=hello\n", \
Kamal::EnvFile.new(env).to_s
ensure
ENV.delete "PASSWORD"
end
test "to_s newline" do
test "env file secret escaped newline" do
ENV["PASSWORD"] = "hello\\nthere"
env = {
"foo" => "hello\nthere"
"secret" => [ "PASSWORD" ]
}
assert_equal "foo=hello\\nthere\n", \
assert_equal "PASSWORD=hello\\\\nthere\n", \
Kamal::EnvFile.new(env).to_s
ensure
ENV.delete "PASSWORD"
end
test "env file secret newline" do
ENV["PASSWORD"] = "hello\nthere"
env = {
"secret" => [ "PASSWORD" ]
}
assert_equal "PASSWORD=hello\\nthere\n", \
Kamal::EnvFile.new(env).to_s
ensure
ENV.delete "PASSWORD"
end
test "env file missing secret" do
env = {
"secret" => [ "PASSWORD" ]
}
assert_raises(KeyError) { Kamal::EnvFile.new(env).to_s }
ensure
ENV.delete "PASSWORD"
end
test "env file secret and clear" do
ENV["PASSWORD"] = "hello"
env = {
"secret" => [ "PASSWORD" ],
"clear" => {
"foo" => "bar",
"baz" => "haz"
}
}
assert_equal "PASSWORD=hello\nfoo=bar\nbaz=haz\n", \
Kamal::EnvFile.new(env).to_s
ensure
ENV.delete "PASSWORD"

View File

@@ -1,17 +0,0 @@
service: app
image: dhh/app
servers:
web:
- "1.1.1.1"
- "1.1.1.2"
workers:
- "1.1.1.3"
- "1.1.1.4"
registry:
username: user
password: pw
boot:
limit: 1%
wait: 2

View File

@@ -13,5 +13,5 @@ registry:
password: pw
boot:
limit: 1%
limit: 25%
wait: 2

View File

@@ -31,7 +31,7 @@ class AccessoryTest < IntegrationTest
end
def assert_accessory_not_running(name)
assert_no_match /registry:4443\/busybox:1.36.0 "sh -c 'echo \\"Start/, accessory_details(name)
refute_match /registry:4443\/busybox:1.36.0 "sh -c 'echo \\"Start/, accessory_details(name)
end
def accessory_details(name)

View File

@@ -18,7 +18,7 @@ services:
build:
context: docker/deployer
environment:
- TEST_ID=${TEST_ID:-}
- TEST_ID=${TEST_ID}
volumes:
- ../..:/kamal
- shared:/shared
@@ -50,19 +50,8 @@ services:
volumes:
- shared:/shared
vm3:
privileged: true
build:
context: docker/vm
volumes:
- shared:/shared
load_balancer:
build:
context: docker/load_balancer
ports:
- "12345:80"
depends_on:
- vm1
- vm2
- vm3

View File

@@ -1,6 +1,6 @@
FROM ruby:3.2
WORKDIR /
WORKDIR /app
ENV VERBOSE=true
@@ -17,8 +17,7 @@ RUN echo \
RUN apt-get update --fix-missing && apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
COPY *.sh .
COPY app/ app/
COPY app_with_roles/ app_with_roles/
COPY app/ .
RUN rm -rf /root/.ssh
RUN ln -s /shared/ssh /root/.ssh
@@ -26,8 +25,7 @@ RUN mkdir -p /etc/docker/certs.d/registry:4443 && ln -s /shared/certs/domain.crt
RUN git config --global user.email "deployer@example.com"
RUN git config --global user.name "Deployer"
RUN cd app && git init && echo ".env" >> .gitignore && git add . && git commit -am "Initial version"
RUN cd app_with_roles && git init && echo ".env" >> .gitignore && git add . && git commit -am "Initial version"
RUN git init && echo ".env" >> .gitignore && git add . && git commit -am "Initial version"
HEALTHCHECK --interval=1s CMD pgrep sleep

View File

@@ -1 +1 @@
SECRET_TOKEN='1234 with "中文"'
SECRET_TOKEN=1234

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "Docker set up!"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/docker-setup

View File

@@ -5,8 +5,7 @@ servers:
- vm2
env:
clear:
CLEAR_TOKEN: 4321
HOST_TOKEN: "${HOST_TOKEN}"
CLEAR_TOKEN: '4321'
secret:
- SECRET_TOKEN
asset_path: /usr/share/nginx/html/versions
@@ -25,10 +24,9 @@ traefik:
args:
accesslog: true
accesslog.format: json
image: registry:4443/traefik:v2.10
image: registry:4443/traefik:v2.9
accessories:
busybox:
service: custom-busybox
image: registry:4443/busybox:1.36.0
cmd: sh -c 'echo "Starting busybox..."; trap exit term; while true; do sleep 1; done'
roles:

View File

@@ -1 +0,0 @@
SECRET_TOKEN='1234 with "中文"'

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "Docker set up!"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/docker-setup

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "Deployed!"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/post-deploy

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "Rebooted Traefik on ${KAMAL_HOSTS}"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/post-traefik-reboot

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "About to build and push..."
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/pre-build

View File

@@ -1,8 +0,0 @@
#!/bin/sh
echo "About to lock..."
if [ "$KAMAL_HOSTS" != "vm1,vm2,vm3" ]; then
echo "Expected hosts to be 'vm1,vm2,vm3', got $KAMAL_HOSTS"
exit 1
fi
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/pre-connect

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "Deployed!"
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/pre-deploy

View File

@@ -1,3 +0,0 @@
#!/bin/sh
echo "Rebooting Traefik on ${KAMAL_HOSTS}..."
mkdir -p /tmp/${TEST_ID} && touch /tmp/${TEST_ID}/pre-traefik-reboot

View File

@@ -1,9 +0,0 @@
FROM registry:4443/nginx:1-alpine-slim
COPY default.conf /etc/nginx/conf.d/default.conf
ARG COMMIT_SHA
RUN echo $COMMIT_SHA > /usr/share/nginx/html/version
RUN mkdir -p /usr/share/nginx/html/versions && echo "version" > /usr/share/nginx/html/versions/$COMMIT_SHA
RUN mkdir -p /usr/share/nginx/html/versions && echo "hidden" > /usr/share/nginx/html/versions/.hidden

View File

@@ -1,37 +0,0 @@
service: app
image: app
servers:
web:
hosts:
- vm1
- vm2
workers:
hosts:
- vm3
cmd: sleep infinity
asset_path: /usr/share/nginx/html/versions
registry:
server: registry:4443
username: root
password: root
builder:
multiarch: false
args:
COMMIT_SHA: <%= `git rev-parse HEAD` %>
healthcheck:
cmd: wget -qO- http://localhost > /dev/null || exit 1
traefik:
args:
accesslog: true
accesslog.format: json
image: registry:4443/traefik:v2.10
accessories:
busybox:
service: custom-busybox
image: registry:4443/busybox:1.36.0
cmd: sh -c 'echo "Starting busybox..."; trap exit term; while true; do sleep 1; done'
roles:
- web
stop_wait_time: 1

View File

@@ -1,42 +0,0 @@
service: app
image: app
primary_role: app
servers:
app:
previously:
- web
hosts:
- vm1
- vm2
jobs:
previously:
- workers
hosts:
- vm3
cmd: sleep infinity
asset_path: /usr/share/nginx/html/versions
registry:
server: registry:4443
username: root
password: root
builder:
multiarch: false
args:
COMMIT_SHA: <%= `git rev-parse HEAD` %>
healthcheck:
cmd: wget -qO- http://localhost > /dev/null || exit 1
traefik:
args:
accesslog: true
accesslog.format: json
image: registry:4443/traefik:v2.10
accessories:
busybox:
service: custom-busybox
image: registry:4443/busybox:1.36.0
cmd: sh -c 'echo "Starting busybox..."; trap exit term; while true; do sleep 1; done'
roles:
- app
stop_wait_time: 1

View File

@@ -1,17 +0,0 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}

View File

@@ -1,3 +0,0 @@
#!/bin/bash
cd $1 && cp -f config/deploy_renamed_roles.yml config/deploy.yml && git commit -am 'Rename roles'

Some files were not shown because too many files have changed in this diff Show More